XSL-FO 分页问题仅生成一页?
我正在通过 XSL-FO 生成 PDF 文档。我有一个像这样的简单 xhtml 结构:
<body>
<h2><center>Status</center></h2>
<table border="0">
<colgroup span="5"></colgroup>
<tr>
<td><h4>Aktion</h4></td>
<td><h4>Kommentar</h4></td>
<td><h4></h4></td>
<td><h4>Zeitpunkt</h4></td>
<td><h4>Benutzer</h4></td>
</tr>
<tr>
<td><h5>Mappe archiviert</h5></td>
<td><h5>QMSAA</h5></td>
<td><h5></h5></td>
<td><h5>26.07.2011 13:14</h5></td>
<td><h5>Mustermann, Peter</h5></td>
</tr>
<tr>
<td><h5>Mappe als pdf gedruckt.</h5></td>
<td><h5></h5></td>
<td><h5></h5></td>
<td><h5>26.07.2011 13:14</h5></td>
<td><h5>Mustermann, Peter</h5></td>
</tr>
....
我正在使用 xhtml to fop 样式表将此 xhtml 转换为 xsl-fo 表。这适用于大多数情况,在这种情况下,我也得到一页内容,但这应该至少是两页。生成时我收到以下警告:
30.08.2011 09:57:36 org.apache.fop.apps.FopFactoryConfigurator 配置 信息:默认页面高度设置为:11 英寸 30.08.2011 09:57:36 org.apache.fop.apps.FopFactoryConfigurator 配置 信息:默认页面宽度设置为:8.26 英寸 30.08.2011 09:57:36 org.apache.fop.fo.flow.TableColumn 绑定 警告:table-layout=“fixed”且未指定column-width =>回到公关 比例列宽(1) 30.08.2011 09:57:37 org.apache.fop.layoutmgr.inline.ContentLayoutManager 警告:标题没有内容 30.08.2011 09:57:37 org.apache.fop.layoutmgr.PageBreaker$1 通知溢出 警告:第 1 页上的区域主体内容溢出了 bl 中的可用区域 锁定进展维度。 (fo:页面序列,没有可用的上下文信息)
我得到的结果是一页内容,其中一个元素溢出页面底部。但其余内容会丢失,不会生成第二页。
- 这里可能有什么问题?
- 一个表的两个 fo:table-row 元素之间是否可以有分页符?
- 为什么没有生成第二页?
I am generating a PDF Document through XSL-FO. I have a simple xhtml structure like this:
<body>
<h2><center>Status</center></h2>
<table border="0">
<colgroup span="5"></colgroup>
<tr>
<td><h4>Aktion</h4></td>
<td><h4>Kommentar</h4></td>
<td><h4></h4></td>
<td><h4>Zeitpunkt</h4></td>
<td><h4>Benutzer</h4></td>
</tr>
<tr>
<td><h5>Mappe archiviert</h5></td>
<td><h5>QMSAA</h5></td>
<td><h5></h5></td>
<td><h5>26.07.2011 13:14</h5></td>
<td><h5>Mustermann, Peter</h5></td>
</tr>
<tr>
<td><h5>Mappe als pdf gedruckt.</h5></td>
<td><h5></h5></td>
<td><h5></h5></td>
<td><h5>26.07.2011 13:14</h5></td>
<td><h5>Mustermann, Peter</h5></td>
</tr>
....
And i am using a xhtml to fop Stylesheet to convert this xhtml to an xsl-fo table. This works for most cases and in this case here i also get one page of content, but this should be at least two pages. While generating i get the following warnings:
30.08.2011 09:57:36 org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-height set to: 11in
30.08.2011 09:57:36 org.apache.fop.apps.FopFactoryConfigurator configure
INFO: Default page-width set to: 8.26in
30.08.2011 09:57:36 org.apache.fop.fo.flow.TableColumn bind
WARNUNG: table-layout="fixed" and column-width unspecified => falling back to pr
oportional-column-width(1)
30.08.2011 09:57:37 org.apache.fop.layoutmgr.inline.ContentLayoutManager
WARNUNG: Title has no content
30.08.2011 09:57:37 org.apache.fop.layoutmgr.PageBreaker$1 notifyOverflow
WARNUNG: Content of the region-body on page 1 overflows the available area in bl
ock-progression dimension. (fo:page-sequence, no context info available)
The result i get is one page of content with one element overflowing the bottom of the page. But the rest of the content is lost, not second page is generated.
- What could be the problem here?
- Is it possible to have a pagebreak between two fo:table-row elements of one table?
- Why is no second page generated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
FO 文档中表格单元格内的块的
keep-with-next.within-column
属性存在问题。如果“always”值替换为“auto”,FOP 1.0 输出四页。这可能是 FOP 中的一个错误。我还使用 XEP 处理了 FO 文档,它生成了四页,没有任何抱怨。
也许您真正想要的是表行上的
keep-together
?我还注意到
上有一个空的font-family
属性。There is a problem with the
keep-with-next.within-column
property on blocks within table cells in your FO document. If the "always" values are replaced with "auto", FOP 1.0 outputs four pages.This could be a bug in FOP. I also processed the FO document with XEP, and it produced four pages without complaining.
Maybe what you really want is
keep-together
on table rows?I also noticed an empty
font-family
attribute on<fo:page-sequence>
.并不是你问题的真正答案,但你可以使用开源 speedata Publisher ,它具有自动表格破坏功能跨页面。它不是 XSL-FO 格式化程序,但类似。目前仅提供德语(这将在 2012 年春季更改),但我知道这对您来说不是问题。
Not really an answer to your question, but you could use the open source speedata Publisher which has automatic table breaking across pages. It is not an XSL-FO formatter but similar. Currently in German only (this will change in spring 2012) but I know that this is not a problem for you.