• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

iText and template.

 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This suffices my requirement.
Thanks,
 
reply
    Bookmark Topic Watch Topic
  • New Topic