Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Itext Templates

 
aadhar sharma
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All


I am a new user of Itext. Currently I am using Inetsoft StyleReports but we are getting performance issues so we decided to evaluate Itext. I have gone through the docs/api's but still I am a beginner.

In my application we have different reports generated based on user selection(The screen has about 5 checkboxes). Each checkbox generates a particular report and if a user selects multiple checkboxes, a combined report is generated.

Each report has its own header and footer which repeats on every page of that particular document. I have seen there is a PDFTemplate class which can be used to set a template, but my problem is if the user selects multiple checkboxes, then each report will have a different PDFTemplate. I am using a listner which attaches the PDFTemplate to a document in onStartPage() method. How can I attach multiple templates to a document.

One possible solution is to generate all pdf's separately and then combine them at the end, but it is not the best approach keeping performance in mind. What I am planning to do is to pass document object to different methods based on user's selection of checkboxes and generate the report. But I cant find a way to attach different templates.

It would be great if some one sends me an example

Thanks in Advance
Aadhar Sharma
 
aadhar sharma
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keep on changing the page event

HeaderFooterPageNumber marker2 = new HeaderFooterPageNumber(payload);
writer.setPageEvent(marker2);
 
aadhar sharma
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might also help as well

http://www.opensubscriber.com/message/itext-questions@lists.sourceforge.net/8725428.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic