views:

120

answers:

4

At the moment, we use MS WORD and MS EXCEL to mail merge documents that needs to be sent to multiple recepients.

For example, say there is a complaint form where the complainant needs to fill in his/her name, address, etc. So we have a .doc file set up with the content and the dynamic entities set up for mail merging, with the name and address details put in an excel file, from where we can happily mail merge to generate all or just the necessary forms/documents.

However, I would like to automate this process, like a form in a website where the complainant can fill in his/her name, address and other details, and we could use that to generate the complaint form automatically and offer it to be downloaded (preferrably as a pdf).

Now, the only solution that comes to mind, is Latex, so that I can just replace the needed entities and just compile to PDF. However, that bit has to be negotiated with the webhost, if they are offering Latex or not.

Is there any other solution? Any other way we could get this done, with something that shouldn't be a problem for most webhosting solutions to offer?

EDIT: I would prefer a non .NET or rather non microsoft solution since, the servers are running linux and while mono might be capable of getting the job done, none of our devs know any .NET languages. However, if required we might have to dwelve into it.

+2  A: 

Generating PDF using an XSL. Check the following: Apoc XSL-FO

You will need to create an XML file with the required fields and transform that with this tool.

A9S6
Thank you. While it looks good enough, I'd prefer a non .NET solution, simply because I dont know any .NET languages, though I will look into it if this is the only other solution
Sujoy
OK. These might be helpful: http://www.sagehill.net/docbookxsl/FOprocessors.html
A9S6
There are lots (?) of non .NET XSL processors.
High Performance Mark
+1  A: 

If you wish to avoid .NET then XSL-FO is worth a look. Try the FOray project. XSLT can be a steep learn if you do not have experience already. Also users will not be able to change the templates without asking the XSLT guru to do it.

If your templates are already in MS Word and MS Excel then I would stick with generating MS docs on the server. These are now easy to work with from code since OpenXML - check out OfficeOpenXML and OpenXMLDeveloper

Andrew
There is something to be said for using docx and xlsx to for the templates, so end users can maintain them.You can then use docx4j or POI to merge the data into them.docx4j can generate PDF.
plutext
I'm inclined to say that, like tagged PDF, docx and xlsx are overkill for this kind of application, unless there are special requirements on the generated document.They're also a tad clunky when realised on a linux server. I prefer to run more minimalist code on mine.
Charles Stewart
+1  A: 
Charles Stewart
+1  A: 

Apache FOP : http://xmlgraphics.apache.org/fop/

Mica