• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

iText and template.

 
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.
 
author
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,
 
He's giving us the slip! Quick! Grab this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!