java使用XSLT从JSON生成PDF的页眉和页脚内容应与表一起显示在所有页面中
我需要从JSON对象生成PDF。我能够生成它,但我知道PDF我有一个表的内容显示
所以这个表应该有一些有限的行,比如pdf中的每页应该显示5行表,其余的行应该转到pdf中的下一页
而且,在每一页上我都应该显示Header
&Footer
和表中的剩余行
比如说
第1页:
Header Content
Table contents
row1
row2
row3
row4
row5
Footer Content
第2页:
Header Content
Table contents
row6
row7
row8
row9
row10
Footer Content
请在这里找到我试图实现逻辑的XSLT代码
<table >
<tr >
<th Pos./Line</th>
<th >Item Code</th>
</tr>
<xsl:for-each select="order">
<xsl:variable name="pos" select="position() mod 5" />
<tr >
<td ><xsl:value-of select="line_number" /></td>
<td ><xsl:value-of select="product_code" /></td>
</tr>
<xsl:if test="$pos = 0">
<table style=" page-break-after: always;">
<tr >
<td >
Hello This is Footer <br />
</td>
</tr>
</table>
</xsl:if>
</xsl:for-each>
</table>
我正在使用XSL 1.0版
共 (0) 个答案