How to export data to pdf?

how should i export data to office documents and pdf in asp.net mvc 3

  • i'm looking for the best way to tackle this issue and in what order we do it best. we have an application where users can enter certain personal details, afterwards they can download the word document (.docx) or get a pdf (.pdf) of their personal data. what we already did is everything separate: with a *.docx template, we fill the parameterized fields and then save it as docx to the user and with a certain library called http://www.biopdf.com/guide/dotnet_interface.php we can convert the rendered word document into a pdf we are looking to avoid having office installed (or any other office tool) on the server, so the current library needs to go, we know of http://sourceforge.net/projects/itextsharp/ as a library to create pdfs, but that would mean that every time the template changes, we need to update our *.docx template for the word files, and at the same time update the iTextSharp code that renders our pdf. are we looking at this the wrong way? in what order should we generate these files, in order to - minimize the work when a template gets changed - have no office programs installed on the server best regards Sander Houttekier

  • Answer:

    as we still have not found a free library that does exactly what we need, we are seriously thinking of buying a license on http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx which does what we need with ease. at least that is what the evaluation shows us ... many of the suggested libraries can to some point generate the pdf with the data we need, but not in the style we want, we needed a system where we have template pdf files, to be filled some parameters, 1 of those parameters beeing a list of products each in its own table with a few rows of data on the product, and none of the above libraries gave sufficient support for that, either every table was on its own page, or the style of the tables needed to be created via the source code generating the pdf, while we had different templates this would have been hell to create code for each different style of each template. so the quest for a free alternative of aspose continues, but for now i will close this one as we found a library that does what we want. (and if i look at the prices of aspose.words, i can only assume they know they are about the only providing these features :P)

Sander at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

I would start by using the http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en, which will allow you to create and manipulate office documents programatically. It does not require you to have Microsoft Office installed or licensed on your server, just a single DLL that can be bin-deployed along with the rest of your application if you want. I haven't played around with dynamic PDF generation (apart from good old GhostScript), so I can't offer any advice there.

Stewart Ritchie

You could have a try with http://www.pdfsharp.net/%28X%281%29S%285almgkadctq453l1mhhtcngk%29%29/Default.aspx It seems as the very same code can draw in a PDF, Printer or Screen.. and MigraDoc can render to RTF. I had this scheduled to integrate with my projects but didn't try it myself, perhaps it fits your project.

Romias

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.