Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to generate word documents dynamically without having word on the machine

I am planning on generating a Word document on the webserver dynamically. Is there good way of doing this in c#? I know I could script Word to do this but I would prefer another option.

like image 664
minty Avatar asked Nov 29 '08 00:11

minty


People also ask

Can you automate Word documents?

Now with Power Automate, there is an easier way. Microsoft Power Automate has a huge range of functionality and with the help of the native Word connector, it is possible to take a prepared Word document and populate it with data from Microsoft Dynamics 365.


1 Answers

I've worked at a company in the past that really wanted generated word documents, in the end they were perfectly satisfied with RTF docs that had a ".doc" extension. Word has no problem recognizing and opening them.

The RTF docs were generated with iText.net (free .net library), the API is pretty easy to use, performs extremely well, you don't need word on the machine, also, you could extend to generating PDF, HTML, and Text docs in the future with very little effort. After four years the solution I created is still in place, so that's a little testimony in iText.net's favor.

It looks like the official iText page suggests that iText Sharp is the best .Net choice right now, so that's another option

like image 100
JB Brown Avatar answered Sep 19 '22 15:09

JB Brown