How should I export data to office documents and pdf in asp.net mvc 3

I am looking for the best way to solve this problem and in what order we do our best.

We have an application in which users can enter certain personal data, after which they can download a document document (.docx) or receive pdf (.pdf) of their personal data.

what we have already done is all separate: with the * .docx template, we fill in the parameterized fields and then save it as a docx for the user

and with some library called BioPdf , we can convert a document converted to a document into pdf

we try to avoid installing an office (or any other office tool) on the server, so the current library should go, we know iTextSharp as a library for creating PDF files, but this will mean that every time we change the template, we need to update our template *. docx for word files and at the same time update the iTextSharp code that displays our pdf file.

Are we considering this wrong? in what order should we generate these files in order to - minimize the work when changing the template - office programs are not installed on the server

Regards Sander Houtteyer

+1
source share
3 answers

since we still have not found a free library that does exactly what we need, we are seriously thinking about buying a license for Aspose.Words which does what we need with ease.

at least that's what the score shows us ...

many of the proposed libraries can at some point generate pdf with the necessary data, but not in the style we need, we needed a system in which we have pdf template files to fill in some parameters, 1 of these parameters representing a list of products, each in its own table, with several rows of data on the product, and none of the above libraries gave sufficient support for this, either each table was on its own page, or the style of the tables that should have been created using the source code creating the pdf, while we had different templates, it would be hell to create code for each style of each template.

therefore, the search for a free alternative to aspose continues, but for now I will close it, because we have found a library that does what we want. (and if I look at the prices of aspose.words, I can only assume that they know that they are concerned with the sole provision of these opportunities: P)

+1
source

I would start by using the OpenXML SDK , which allows you to programmatically create and process office documents.

This does not require Microsoft Office to be installed or licensed on your server, only one DLL that you can deploy with the rest of the application if you want.

I did not play with the dynamic PDF generator (except for the old old GhostScript), so I can not offer any advice.

0
source

You can try with PDFSharp y MigraDoc

It seems that the same code can draw in PDF, Printer or Screen .. and MigraDoc can display RTF.

I planned to integrate with my projects, but I haven’t tried it myself, maybe it fits your project.

0
source

All Articles