- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一些很长的表格,它们跨越多个页面,用 Apache-FOP 1.1 呈现
表格有标题,例如“表 7.6. 事物的详细信息”和列标题。
在每个连续页面上,列标题在顶部正确重复。但我还需要让表格延续也有标题,格式为:“表 7.6. 细节(续)”
有没有办法用 XSL-FO 和 Apache-FOP 做到这一点?或者它是否需要通过 RenderX 提供的扩展?
最佳答案
我不知道有什么方法可以在 FOP 中做到这一点,但这可能是因为除了基本的 PDF 生成之外,我还没有将 FOP 用于任何其他方面。
使用 RenderX (XEP),您可以设置您的 fo:table-header
到您想在后续页面上使用的任何标题,并使用常规 fo:block
对于初始标题。
然后您可以使用 rx:table-omit-initial-header="true"
您的 fo:table
上的属性首次输出表时不输出表头。
这是 RenderX 4.18 渲染的示例...
示例 XSL-FO
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:rx="http://www.renderx.com/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="my-page" page-width="8.5in" page-height="11in">
<fo:region-body margin="1in" margin-top="1.5in" margin-bottom="1.5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="my-page">
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="12pt" font-weight="bold"
text-align="center" space-after="6pt">Sample Table</fo:block>
<fo:block>
<fo:table rx:table-omit-initial-header="true" space-before=".08in">
<fo:table-column column-width="100%"/>
<fo:table-header>
<fo:table-cell>
<fo:block font-weight="bold"
font-size="12pt" text-align="center"
space-after="6pt">Sample Table (Cont)</fo:block>
</fo:table-cell>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:table border-style="solid" border-width="1pt" padding="6pt">
<fo:table-column column-number="1" column-width="20%"/>
<fo:table-column column-number="2" column-width="80%"/>
<fo:table-header font-weight="bold">
<fo:table-cell text-align="left">
<fo:block>Column 1</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Column 2</fo:block>
</fo:table-cell>
</fo:table-header>
<fo:table-body>
<fo:table-row padding-before="20px">
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>Lorem ipsum dolor sit amet</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Ten years ago a crack commando unit was sent to prison by a military court for a crime they didn’t commit. These men promptly escaped from a
maximum security stockade to the Los Angeles underground. Today, still wanted by the government, they survive as soldiers of fortune.</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
关于xsl-fo - 当表格跨越多页时,如何让 XSL-FO 表格标题在每一页上重复?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13922082/
我有一个 XML 输入文件,可以说 shipnote.xml其中包含一个零件项目列表。部分项目具有通常的属性 qty , partno和 label .每个项目都分配给一个 packetno . 我写
我们客户的要求是提供带圆角的 PDF 表格。我只有 Apache FOP 处理器可供我使用,它不支持圆角属性。它也不支持 float ,因此无法向左和向右 float 圆形图像。 你对如何做到这一点有
我的 FO 流程有问题,因为在一页上,标题显示在一页的末尾并在之后的页面上继续。如何向 title-element 添加属性,以便标题始终显示在同一页面上,这意味着:没有分页符。 谢谢! /丹尼 最佳
我希望 column-count="2"只出现在页面的某些部分。 ]>
我正在为我的 XML 内容生成 xsl-fo 文档,然后将此内容传递给将生成 PDF 的第三方 DLL 之一。我需要以 45 度角显示测试。如何实现这一目标? 谢谢 最佳答案 我很确定您不能在纯 XS
在我的情况下,我必须在两个表格行之间提供高达 0.5cm 的空间。我怎样才能做到这一点。 代码:: 我用过了:
我正在从我的 xsl 和 xml 文件生成一个 pdf,其中我需要在第一页的末尾显示一个表格。但是由于该表格上方还有一些表格,将其显示为静态文本会将其向下推到第 2 页(或第 3 页,依此类推)。所以
我正在从 xml 和 xsl-fo 以及 Apache FOP 创建一个 pdf 文件,我需要在一行上写文本。我的意思是类似于手工编辑的表格,你可以在其中写上名字、姓氏等。是这样的:姓名:______
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
在我的 XSL 页面主代码看起来像这样......
我有一些很长的表格,它们跨越多个页面,用 Apache-FOP 1.1 呈现 表格有标题,例如“表 7.6. 事物的详细信息”和列标题。 在每个连续页面上,列标题在顶部正确重复。但我还需要让表格延续也
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 2年前关闭。 Improve t
我创建了一个 XSL-FO 模板,它打印了一些包含动态变化的文本的块。有时一个块被分成两页,因为页面上没有足够的空间。有没有办法将块放在下一页而不是在不适合的情况下将其拆分到页面上?我试图将它放入一个
我有一个非常简单的模板: 我如何告诉DO即使块为空也要保留空行。 最佳答案 只需在的末尾添加一个元素。像这样:
我有一个 fo:block 可能跨越一个页面。我想在该 block 所在的第一页的底部放置一些文本,例如“继续”。 源文档在 标记内有一系列 。 我认为做到这一点的唯一方法是在源文档的正确位置添加下一
我为 sp_sign 获得的值(如下所示)我想将其用作 fo:external graphics 的 src 。我尝试了很多事情仍然没有运气请帮助。 // 提前致谢 问候,
我正在使用 XSL:FO 和 Apache FOP 创建可访问的文档。要确认可访问性,PDF Accesibility Checker 3 (PAC3)应该使用。不幸的是,检查器提示每个表格单元格边框
我正在使用 XSL:FO 和 Apache FOP 创建可访问的文档。要确认可访问性,PDF Accesibility Checker 3 (PAC3)应该使用。不幸的是,检查器提示每个表格单元格边框
我正在以这种方式在 XSL FO 文档中创建背景文本: Background Watermark Text
我有一个 .xml 文件,我想生成一个 .pdf 文件。我使用 xsl-fo 来实现这一点。 问题是我无法请求当前页面的编号以将其存储到变量中,而是根据其值做出不同的事情。 具体:如果当前页面是0模3
我是一名优秀的程序员,十分优秀!