How to export FlowDocument to DOC (x) or XLS

In my program, I create several reports in FlowDocument and display them using the DocumentViewer control. Now I need to add more export options. I use iTextSharp to export to PDF, and I can save on XPS natively. Is it possible to save the document directly in any office format, DOC or XLS. Or maybe someone knows a good library for converting from PDF / XPS to DOC or XLS?

+6
source share
2 answers

I have found a solution. Since I cannot automatically export Doc from WPF, I reproduced the layout of the DocX Library page. This is a truly awesome and simple library that does not require MSOffice to create Word 2007/2010 files.

+3
source

I'm not sure if you are looking for an answer, so I will be brief. You can use Microsoft Interop assemblies to create Word documents. This is not a difficult task, but, in my opinion, it is easier than using iTextSharp. They come with Visual Studio.

To create XPS documents, you need to generate FixedDocument objects from your FlowDocument , but from there it's just a few lines of code. Eric Sink has a good article in which you can find here . This question is also mentioned here.

+1
source

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


All Articles