Using C # to create a Word document from an existing template

I have several Word templates, and I want to use them to dynamically create Word documents in my application. I want to avoid using automation at all costs, as this is not good. I know that I can use both HTML and XML to create text documents, but I just don't know where to start using a template that can have images in the footer or header of the document.

+3
source share
3 answers

I am using the OpenXML SDK with Word 2007. After you get it, it is not so bad. I have several docx template files that I look through to search and replace placeholder strings with what I want, and then I can stitch several templates into one document if I want. This is good, because I can start with docx files as a template and change them as long as I stay within the scope of the docx format all the time. If the image is in docx, when you start changing it, it will be there after you save it after modification (provided that you have not excluded it programmatically).

If you have more detailed information about what you will do, let us know.

+5
source

DocX. , , . DOCX. ​​ , . .

.

+2

MigraDoc http://www.pdfsharp.net/MigraDocOverview.ashx - PDF/Word/HTML. , , DDL .

0

Source: https://habr.com/ru/post/1740000/


All Articles