1
我需要在一个特定的布局中生成PDF文件,支持多个PDF页面等。我可以想象,我可以将gsp输出呈现为pdf,但我如何处理多个页面的概念?任何建议?Grails使用特定布局和多个页面呈现PDF?
我需要在一个特定的布局中生成PDF文件,支持多个PDF页面等。我可以想象,我可以将gsp输出呈现为pdf,但我如何处理多个页面的概念?任何建议?Grails使用特定布局和多个页面呈现PDF?
我使用的飞碟,通过渲染插件:http://www.grails.org/plugin/rendering
对于多页,用一些CSS2,如:
@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;
}
然后,你将有一个页面,每次打破你使用<div class="break"/>
您标题将显示为<div id="header"/>
,而您的页脚显示为<div id="footer"/>