Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to build a web application for generating stylish PDF documents. The layout should be based on a design templates and the data should come dynamically from the database. Ideally I want to design the template in a "publishing like" tool with placeholders and replace these placeholders by the web application with the data from the database. Think of something like an invoice generator, where a customer could choose from different invoice templates and the invoice data itself coming from the DB. Thanks for your ideas!

share|improve this question
latex of course! see also this question:… – Gerhard Burger May 27 '13 at 11:08

I have used Java, Jasper Reports and iReport for a similar task. Hope that helps.

share|improve this answer

I use perl (with HTML::Template) to generate an .ods document from database data, then I use unoconv to convert it to pdf. To be precise:

  • first, create an .ods document that looks good. Make sure the variable fields are recognizable.
  • unzip the .ods document and edit the file contents.xml.
  • in contents.xml, change all the variable fields to <TMPL_VAR> tags as per HTML::Template. This contents.xml file is going to be your template.
  • write a Perl program that reads the database, fills the TMPL_VAR fields, writes a new contents.xml file and re-zips the new contents.xml file into a new .ods document.
  • then use unoconv to convert the new document to pdf.

Easily extended to use more than one template.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.