Reputation: 15929
i need to generate pdf files in a specific layout with support for multiple pdf pages etc.. I can imagine that i could render gsp output to a pdf but how can i handle the concept of multiple pages? Any suggestion?
Upvotes: 1
Views: 3645
Reputation: 6733
i am using flying saucer, through the rendering plugin: http://www.grails.org/plugin/rendering
For multiple pages, use some CSS2 like:
@page {
size: 210mm 297mm; // A4 format
@bottom-center { content: element(footer);} // if you want footer
@top-center { content: element(header); } // if you want header
}
div.break {
page-break-after:always;
}
Then you will have a page break each time you use <div class="break"/>
your header will be into <div id="header"/>
and your footer into <div id="footer"/>
Upvotes: 11