【发布时间】:2019-03-20 20:40:04
【问题描述】:
如何让fo:flow 正文中的最后一个fo:block 与最后一页的底部对齐?
我不是指每一页的页脚部分,没关系,但我希望在最后一页的底部有流体中的最后一个块。
流体的内容多种多样,不知道最后一个block段的高度是多少。
有没有可能做点什么?
【问题讨论】:
-
an answer to a similar question 的另一种可能的解决方案:使用 脚注。
如何让fo:flow 正文中的最后一个fo:block 与最后一页的底部对齐?
我不是指每一页的页脚部分,没关系,但我希望在最后一页的底部有流体中的最后一个块。
流体的内容多种多样,不知道最后一个block段的高度是多少。
有没有可能做点什么?
【问题讨论】:
如果您使用的是 AH Formatter,您可以让最后一个块浮动到页面底部。
您可以将最后一个块放在fo:block-container 中,并将fo:block-container 绝对定位在页面底部。
您可以将最后一个块放在只出现在最后一页的页脚中:
fo:simple-page-master
fo:region-after 和不同的 master-name 值fo:region-after 上指定display-align="after" 以确保其内容显示在底部fo:page-sequence-master 中,使用包含 fo:conditional-page-master-reference 的 fo:repeatable-page-master-alternatives 在具有 page-position="last" 的替代项中的早期,并为最后一页选择您的页面母版fo:page-sequence 中,创建一个带有master-reference 的fo:static-content,与最后一页的xsl:region-after 的flow-name 匹配fo:static-content
【讨论】:
一个应该有效的简单技巧(我使用 FOP 2.3 成功测试了它):
<fo:block keep-with-previous.within-page="always"
space-before.minimum="1cm"
space-before.optimum="30cm"
space-before.maximum="30cm">
Text at the end of the last page
</fo:block>
【讨论】: