- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
The following feature isn't implemented by Apache FOP, yet: table-layout="auto" (on fo:table)
我在控制台中收到以上警告。我正在尝试导出到文档。使用相同的 XML 和 XSLT,我可以导出到 PDF,但导出到 doc 会得到空白文档。
--------------- My XML -----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<export>
<signPost>
<organisationName>Organisation NEW TEST1</organisationName>
<address1>Address Line 1</address1>
<address2>Address Line 2</address2>
<address3>Address Line 3</address3>
<postCode>N194eh</postCode>
<phNumber>07999999999</phNumber>
<email>newmeh@meh.com</email>
<url>www.NOTnewmeh.com</url>
<profile>tee</profile>
</signPost>
<signPost>
<organisationName>Test Meta Organization</organisationName>
<address1 />
<address2 />
<address3 />
<postCode>N194EH</postCode>
<phNumber />
<email />
<url />
<profile />
</signPost>
<signPost>
<organisationName>Test Org Meta</organisationName>
<address1>Address Line 1</address1>
<address2>Address Line 2</address2>
<address3>Address Line 3</address3>
<postCode>N194EH</postCode>
<phNumber>07999999999</phNumber>
<email>newmeh@meh.com</email>
<url>www.NOTnewmeh.com</url>
<profile>Profile</profile>
</signPost>
<signPost>
<organisationName>eeeeeewe</organisationName>
<address1>Address Line 1</address1>
<address2>tee</address2>
<address3>Address Line 3</address3>
<postCode>n124jj</postCode>
<phNumber>07777777777</phNumber>
<email>meh@meh.com</email>
<url>meh.com</url>
<profile>Profile</profile>
</signPost>
<signPost>
<organisationName>sdfsdfs</organisationName>
<address1>Address Line 1</address1>
<address2>Address Line 2</address2>
<address3>Address Line 3</address3>
<postCode>a332kk</postCode>
<phNumber>07999999999</phNumber>
<email>newmeh@meh.com</email>
<url>www.NOTnewmeh.com</url>
<profile>Profile</profile>
</signPost>
<signPost>
<organisationName>this</organisationName>
<address1>Address Line 1</address1>
<address2>Address Line 2</address2>
<address3>Address Line 3</address3>
<postCode>n377mm</postCode>
<phNumber>07999999999</phNumber>
<email>newmeh@meh.com</email>
<url>www.NOTnewmeh.com</url>
<profile>Profile</profile>
</signPost>
<signPost>
<organisationName>New Org</organisationName>
<address1>Address Line 1</address1>
<address2>Address Line 2</address2>
<address3>Address Line 3</address3>
<postCode>NW1 2SD</postCode>
<phNumber>07999999999</phNumber>
<email>newmeh@meh.com</email>
<url>www.NOTnewmeh.com</url>
<profile>Profile</profile>
</signPost>
</export>
---------------------------
----- MY XSLT -----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="form"
page-height="29.7cm" page-width="21.0cm" margin-right="2cm"
margin-left="1cm" margin-top="1cm" margin-bottom="0cm">
<fo:region-body margin-top="1cm" margin-bottom="1cm" />
<fo:region-before region-name="header" extent="1cm" />
<fo:region-after region-name="footer" extent="1cm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="form">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="export" />
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="export">
<fo:table >
<fo:table-body>
<xsl:for-each select="signPost">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">
<fo:table-row>
<fo:table-cell>
<fo:block padding-top="2mm">
<xsl:value-of select="organisationName" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>
最佳答案
尝试在您的 fo:table 中添加 table-layout="fixed",使其变为:
<fo:table table-layout="fixed">
您可能还需要添加表格的宽度
<fo:table table-layout="fixed" width="100%">
如果仍然收到警告,请尝试定义列的宽度:
...
<fo:table-column column-width="30%"/>
<fo:table-body>
...
但是,我怀疑您是否因为这个警告而得到一个空白文档。如果您执行以下操作,您会得到什么?
<xsl:template match="export">
<fo:block>test</fo:block>
</xsl:template>
关于xml - 以下功能未由 Apache FOP 实现,但 : table-layout ="auto" (on fo:table),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32646189/
我使用嵌入在 Java 应用程序中的 Apache FOP 1.1 成功地将 XML 转换为 PDF。不幸的是,我被指示降级到 FOP 1.0 以遵守公司许可。因此,我用 1.1 jar 替换了 1.
我刚刚使用 Apache FOP 制作了要提交给照片打印服务的 PDF/X 相册。一切似乎都很好,但字距调整。使用自定义衬线字体,例如“portfolio”这个词没有正确呈现(问题在于 f-o,因为
我需要使用 XSL - Apache FOP (Java) 将 XML 转换为 PDF 文档。我收到以下错误 The method getDefaultHandler() is undefined f
我已将 FOP 版本从 fop 1.1 升级到 fop 2.3 版本,但得到 org.apache.fop.events.LoggingEventListener processEvent Image
现在我正在开发一个调用 SOAP Web 服务的 JDK-14 应用程序,在收到 XML 结果之后,它接下来必须调用一个方法来通过 Apache FOP 库生成 PDF 文档。请注意,我没有为此项目使
我最近在现有应用程序中添加了一个 fop pdf 生成器。在本地一切正常,但当我部署到 Azure 上时,出现以下错误: org.apache.fop.apps.FOPException: .fop
我用: Apache fop 1.0 Java 我需要处理 unicode 高于 u0100 的特殊字符。我应该使用的目标字体是 Arial。由于我不能期望目标平台(例如 Linux)上存在 Aria
无法在 fop 中获取外部字体,正在获取消息: java.lang.UnsupportedOperationException:类 org.apache.fop.fonts.FontCache 不允许
我想创建一个有效的 PDF/A2-b 文件。在那之后想用 PDFLib 库输入 ZUGFeRD 发票。 每次我用 Online Validator 查看 PDF我收到以下错误: rechnung.pd
使用 asdf 版本管理器安装 Erlang 时,上面的构建警告表明 apache fop library没有安装在系统上,或者没有被 asdf 版本管理器识别。结果是 Erlang 文档不会作为安装
我使用 ikvm 从 fop-1.0 生成了 fop.dll: ikvmc -target:library -reference:IKVM.OpenJDK.Core.dll -recurse:{myP
我使用了 apache FOP 2.0 jar 和下面的代码 FopFactory fopFactory = FopFactory.newInstance(new File(".")); 并出现以
我需要帮助在 Java 中使用 FOP 显示西里尔字符。 我创建了内容的 xml 和将格式化新 PDF 的 xsl 文件。 它们都使用 UTF-8 字符编码。 但在结果文件中,我只看到“#”字符而不是
我正在尝试使用 FOP 生成 PDF。 我的要求—— 第 1 页 - 标题和内容 第 2 页 - 条款的静态页面 第 3 页 - 从第 1 页溢出 但是,当第 1 页没有溢出时,不会生成第 2 页。即
我正在使用 org.apache.xmlgraphics FOP 2.3 来生成表格。表的其中一列包含一个复合标识符,该标识符包含由正斜杠分隔的四个部分 注意:我在使用 1.1 版 FOP 时也遇到了
即使页面不包含前向引用并且 block 非常小,如何避免 FOP 消耗越来越多的内存? 这是一个测试 java 程序,它使用手工制作的 FO 为 FOP 提供数据,该 FO 只是一遍又一遍地重复相同
你好,我正在尝试使用 FOP 将 xml 文件转换为 pdf,但我一直遇到错误,现在我遇到了错误 Exception in thread "main" java.lang.NoClassDefFoun
我目前正在使用 FOP 从 XML 文件生成 PDF。 但我面临着两个大问题: 第一:FOP无法管理OpenType字体文件 其次:fo:float还没有实现 所以我不可能用 FOP 生成我想要的 P
嗨,我想使用 FOP 准备一个 XML 文档以供打印 (ps/pdf)。是否可以将参数发送到 FOP 以执行 xsl 处理器中存在的条件格式 XSL: no .... Copy ....
我正在使用 Apache FOP 将我的文件打印成 PDF。从 FO 转换为 PDF 时出现以下错误: Invalid property value encountered in column-num
我是一名优秀的程序员,十分优秀!