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

minty picture minty · Nov 29, 2008 · Viewed 10.4k times · Source

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.

Answer

JB Brown picture JB Brown · Nov 29, 2008

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