Displaytag is a very nice JSP Component to display data lists. If you don’t know Displaytag, this article is probably not for you…
Anyway Displaytag provides a function to export the list as PDF. Unfortunally there is a problem with large lists (>20k entries), it just takes us all the memory and your application may throw an OutOfMemoryException. I created a custom PDF export class which should fix this problem and add’s the possibility to define a custom header and footer line.
Just add the following lines to your displaytag.properties file:
1 2 | pdf.export.header=Your Header pdf.export.footer=Your footer — Page |
export.pdf.class=com.CHANGE.IT.NicePdfExport
and add THIS file to your project.

3 Comments
1 Lotfi wrote:
Thank you for this great work, but whwt do you mean exactelly with:
Your Header and Your footer — Page.
thank you very much.
2 michu wrote:
the text you want to display in the pdf report.. the header and the footer…
3 kc wrote:
Thanks for the example. Works brilliant!!!