Xsl fo 如何指示fo:块跨越页面
我有一个fo:block,它可能跨越一个页面。我想在块所在的第一页底部放置一些类似“continued”的文本 源文档在标记中有一系列的 我能看到的唯一方法是在下一页的正确位置向源文档中添加一个Continued,但这需要在编写文档时不断进行编辑 是否有一个测试来查看一个块是否跨越一个页面 源文件:Xsl fo 如何指示fo:块跨越页面,xsl-fo,Xsl Fo,我有一个fo:block,它可能跨越一个页面。我想在块所在的第一页底部放置一些类似“continued”的文本 源文档在标记中有一系列的 我能看到的唯一方法是在下一页的正确位置向源文档中添加一个Continued,但这需要在编写文档时不断进行编辑 是否有一个测试来查看一个块是否跨越一个页面 源文件: 第一件事 第二件事 样式表的相关部分: 避免 alwaysauto 谢谢。使用标记。将所有内容放入fo:table中,并在fo:table footer中使用fo:retrieve tabl
第一件事
第二件事
样式表的相关部分:
避免
alwaysauto
谢谢。使用标记。将所有内容放入
fo:table
中,并在fo:table footer
中使用fo:retrieve table marker
(请参阅),或在fo:static content
中使用fo:region之后的fo:region中的。不同之处在于,使用fo:table
方法,“continued”指示可以立即出现在页面上最后一个文本之后(如本例中所示),而不是使用fo:retrieve marker
方法在页脚中的固定位置
虽然Tony的建议可行,但它只适用于支持该构造的格式化程序。正如他所建议的,在页脚中插入纯标记也可以这样做。在内容结尾和页脚之间的垂直空间中,您可能没有太多的控制权,但控制权取决于您的内容
您只需在页脚区域中使用检索标记,例如:
<fo:static-content flow-name="footer">
<fo:block-container text-align="left" margin-left="1in">
<fo:block><fo:retrieve-marker retrieve-class-name="continued" retrieve-boundary="page" retrieve-position="last-starting-within-page"/>
</fo:block>
</fo:block-container>
</fo:static-content>
现在,在您的流中有一些块,您希望消息在该块断开页面时显示在其中。您可以使用以下内容:
<fo:block-container>
<fo:marker marker-class-name="continued">I am continued on next page ...</fo:marker>
<fo:block margin-top="6pt">I am some text that will break across the page somewhere. When I do break the footer should have continued. I am some text that will break across the page somewhere. When I do break the footer should have continued. </fo:block>
<!-- More content here, whatever you need -->
</fo:block-container>
<fo:block-container keep-with-previous.within-page="always">
<fo:marker marker-class-name="continued"></fo:marker>
</fo:block-container>
我在下一页继续。。。
我是一些文字,将打破页面的某个地方。当我打破了页脚应该继续。我是一些文字,将打破页面的某个地方。当我打破了页脚应该继续。
块容器中的第一个标记将创建一个带有所需连续文本的“标记”。如果页面在该块内断开,标记将被拉入页脚区域。第二个标记有效地“清除”了它,因为它没有内容。它被拉到页脚,但为空,因此不会显示任何内容
结果是这样的,不存在连续文本(第1、3、4页),除非页面在标记有连续消息的区域(第2页)内断开
如果我理解正确,如果
的格式跨越多个页面,您希望显示“continued”,对吗?许多xsl fo引擎不支持检索表标记,这里不需要它。只需在内部使用块容器设置标记,然后清除标记。
<fo:static-content flow-name="footer">
<fo:block-container text-align="left" margin-left="1in">
<fo:block><fo:retrieve-marker retrieve-class-name="continued" retrieve-boundary="page" retrieve-position="last-starting-within-page"/>
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:block-container>
<fo:marker marker-class-name="continued">I am continued on next page ...</fo:marker>
<fo:block margin-top="6pt">I am some text that will break across the page somewhere. When I do break the footer should have continued. I am some text that will break across the page somewhere. When I do break the footer should have continued. </fo:block>
<!-- More content here, whatever you need -->
</fo:block-container>
<fo:block-container keep-with-previous.within-page="always">
<fo:marker marker-class-name="continued"></fo:marker>
</fo:block-container>