• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

iText and template.

 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not worked with iText much, but I have a question regarding iText.
Does iText support some sort of template file , so that we can merge template and data objects at runtime to generate the pdf.
 
Bruno Lowagie
author
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Bhattacharjee:
Does iText support some sort of template file

You could use a PDF document containing an AcroForm, then use iText to fill in the fields that are inside this form. If you have a PDF without these AcroFields, you could still use PdfStamper to add text or images (a watermark) at specific coordinates on the page. There's also an example in the book (chapter 14) where I have a letter in XML with some empty tags that should be replaced by a name, an address,... In the real world I use this technique to create a document with 27,000 pages. Each page is an invoice for the students of Ghent University with a detailled descriptions of the different study programs he or she has subscribed too.

Note that PDF is not a format that is suitable for editing! PDF is a Page Definition Language (PDF), not a Word processing format.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This suffices my requirement.
Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic