Closed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago .I need to take a Word document that is a template of sorts. collect user input to populate specific fields in that template..then generate a PDF file that includes the completed template as well as a few other document types. Does anyone have a good suggestion on a component to achieve this? Preferably one that does not require Microsoft Office to be installed on the web server.
asked Sep 17, 2008 at 17:03 173 1 1 gold badge 4 4 silver badges 8 8 bronze badgesTry Aspose Words for .net. From their website: "Aspose.Words enables .NET and Java applications to read, modify and write Word® documents without utilizing Microsoft Word." Utilizing Aspose Words with Aspose PDF permits you to output to PDF.
One thing you do NOT want to do is install MS Word on your production server. Loading those objects is SLOW and EATS memory. You won't be able to use the CutePDF Writer unless you also install MS Word on the server. Yeck.
answered Oct 8, 2008 at 22:15 Robert C. Barth Robert C. Barth 23.2k 6 6 gold badges 47 47 silver badges 53 53 bronze badgesIs there a reason to use Word? If you start with a PDF with Form fields, you can either allow the user to fill out the fields, or do it programatically with iTextSharp's PDF stamper.
If you need to use MSOffice 2000/2003 components programmatically, you can try Office Web Components. They do need to be installed on the server, but can be used by .NET and Com apps to interact with office file types. More info here. http://en.wikipedia.org/wiki/Office_Web_Components
If you dig about on an office CD you should find the OWC installer for your version. I haven't worked with 2007, but I assume there is something similar available.
iTextSharp and OWC are no-cost, check the licensing for more details.
answered Sep 17, 2008 at 17:08 StingyJack StingyJack 19.3k 11 11 gold badges 65 65 silver badges 126 126 bronze badgesThe only reason we'll be using Word is for the users' ease of use. These templates change on a some what regular basis, so they need to be able to change them and most of the users only have PDF Reader software installed. Thanks for your advice though. :-)
Commented Sep 17, 2008 at 17:12Hmmm. You might be able to employ CutePDF printer in a creative way to solve this problem. Essentially, it takes anything that can be fed through a standard print driver and makes a PDF out of it. It's free.
answered Sep 17, 2008 at 17:10 611 8 8 silver badges 13 13 bronze badgesI am familiar with CutePDF since I use it personally to print many things to PDF. I've never thought about using it in a server environment. I'll definitely think about that.
Commented Sep 17, 2008 at 17:14Try using The Apache POI API to populate the fields. It can get into Word documents and access their elements.
As for the Word -> PDF step, I'd also recommend evaluating the Aspose solution. It may even be able to perform both steps. Its not free, however.
answered Jan 12, 2009 at 23:34 nasty pasty nasty pasty 7,018 7 7 gold badges 25 25 silver badges 26 26 bronze badgesMy first thought for a "doc template" + merge to pdf solution would be to start with open office formats. - the odt file (open document template) is xml-based - so you could even use perl, to do the merge, then call writer's doc 2 pdf (I have no idea if they have an API, but one could find out in less than a day - even if one had to examine the source.)
and converting your "word" dot to a writer odt file is just a "file save as" operation in OoWriter.
answered Jan 22, 2009 at 20:16 602 1 1 gold badge 7 7 silver badges 9 9 bronze badgesIf you use Aspose.Words, then your input document/template can be in one of the several supported formats including DOC, DOCX.
Then you can insert data into the document in a number of ways. You can use bookmarks in a document and just set their text. Or better yet use the reporting engine we provide. It allows to use standard MS Word MERGEFIELD fields plus adds capabilities for repeating regions and even nested. E.g. you can design an invoice (with parent/child data) template in MS Word and then populate from a .NET DataSet in one line of code.
Also, you only need Aspose.Words to produce PDF (a year ago you needed both Aspose.Words and Aspose.Pdf). You can also easily save the exactly the same looking document to DOC, DOC, DOCX and a few other formats.
I'm on the Aspose.Words dev team.