多页 pdf,每个人标签使用翻页
Multi page pdf using fop-one page for each person tag
我需要使用 xsl-fo 模板将我的 xml 数据转换为使用 fop 的 pdf。
我的 XML 数据看起来像。
<resultset>
<person>
</person>
<person>
</person>
<person>
</person>
</resultset>
每个人标签都需要进入 pdf 中的单独页面。能
有人请用示例 xsl-fo 模板指导我。
两种选择:
- 在您从
person
生成的 FO 上使用 break-before="page"
。 (参见 https://www.w3.org/TR/xsl11/#break-before。)
- 为每个
person
开始一个新的 fo:page-sequence
。 (参见 https://www.w3.org/TR/xsl11/#fo_page-sequence。)
这将帮助您入门,具体取决于人员标签中的信息。
<xsl:template match="person">
<fo:block page-break-before="always">
process the contents of the person tag here
</fo:block>
</xsl:template>
我需要使用 xsl-fo 模板将我的 xml 数据转换为使用 fop 的 pdf。 我的 XML 数据看起来像。
<resultset>
<person>
</person>
<person>
</person>
<person>
</person>
</resultset>
每个人标签都需要进入 pdf 中的单独页面。能 有人请用示例 xsl-fo 模板指导我。
两种选择:
- 在您从
person
生成的 FO 上使用break-before="page"
。 (参见 https://www.w3.org/TR/xsl11/#break-before。) - 为每个
person
开始一个新的fo:page-sequence
。 (参见 https://www.w3.org/TR/xsl11/#fo_page-sequence。)
这将帮助您入门,具体取决于人员标签中的信息。
<xsl:template match="person">
<fo:block page-break-before="always">
process the contents of the person tag here
</fo:block>
</xsl:template>