• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generation of Dynamic PDF/Word doc from the template

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All.

After a long time here in this forum  

I am looking for a kind of solution where we have to dynamically generate pdf or word document based on some parameters using some predefined template. Now I need some suggestion, how to go ahead and attack the problem.
What I understand is to convert the template into a XML and then parse the XML and generate the PDF with the dynamic values on the run time. Please help me here with your suggestion or approach.

Thanks in advance
Samrat
 
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are various ways to tackle this, and it's hard to recommend one over the other given the lack of detail. You could use FlyingSaucer library to render CSS-styled XHTML or XML as PDF. Or, if you have highly regular data in XML form, you could use Apache FOP to render it to PDF using an XSL-FO stylesheet. If the data is rather irregular, writing code using the iText or PDFBox APIs to create PDFs would be an option.

Alternatively, you can create RTF templates and search-and-replace placeholders in that. RTF can be opened by just about any wordprocessor, so is a good substitute for actual Word files (which are much harder to create).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic