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

后端 未结 8 1885
轻奢々
轻奢々 2021-01-30 15:15

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

8条回答
  •  温柔的废话
    2021-01-30 15:42

    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

提交回复
热议问题