What's the best way to convert a FlowDocument into PDF

前端 未结 6 2160
萌比男神i
萌比男神i 2021-02-04 13:36

How would ya\'ll recommend that I convert a FlowDocument to PDF to be attached to an EMail?

The FlowDocument is dynamic, not static.

I would prefer to be able to

6条回答
  •  悲哀的现实
    2021-02-04 14:29

    You have two options that I know of.

    The first is to use a proprietary library called NiPDF, alternatively you can use Word Interop.

    1. Save the FlowDocument to a DOCX file using Open XML SDK
    2. Use Word Interop to load the saved document from some temporary store
    3. Set the WdSaveFormat to wdFormatPDF
    4. Save the document again (remember to rename the file to PDF)

    You can find further info here

提交回复
热议问题