gpt4 book ai didi

java - FOP 未在正斜杠上正确换行

转载 作者:行者123 更新时间:2023-12-02 10:38:45 28 4
gpt4 key购买 nike

我正在使用 org.apache.xmlgraphics FOP 2.3 来生成表格。表的其中一列包含一个复合标识符,该标识符包含由正斜杠分隔的四个部分

注意:我在使用 1.1 版 FOP 时也遇到了同样的问题,但我已尝试升级。

使用以下代码片段,我得到一个 pdf(下图),其中在标识符为“100000000006//32143214321/DFSG”的一行中,不显示第二个正斜杠。我可以选择文本并且所有正斜杠都存在。

我的格式错误是什么?

注意:如果我在所有空格之间使用带有文本的标识符,例如。 “100000000006/1/32143214321/DFSG”所有文本均按预期显示。

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="spm1" page-height="595.45pt" page-width="792.0pt">
<fo:region-body column-count="1" margin-bottom="57.6pt" margin-left="45.0pt" margin-right="45.0pt" margin-top="60pt" region-name="region-body"/>
<fo:region-start extent="80pt" reference-orientation="90" region-name="regstart"/>
<fo:region-end extent="80pt" reference-orientation="270" region-name="regend"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="spm1">
<fo:static-content flow-name="regstart">
<fo:block/>
</fo:static-content>
<fo:static-content flow-name="regend">
<fo:block/>
</fo:static-content>
<fo:flow flow-name="region-body">
<fo:block background-color="white" color="black" font-family="Times New Roman, Times" font-size="12.0pt" font-style="normal" font-variant="normal"
font-weight="normal" orphans="2" text-align="start" text-decoration="none" text-indent="0pt" vertical-align="baseline" widows="2">

<fo:block hyphenate="true" font-family="Arial, Helvetica" font-size="8pt">
<fo:leader line-height="10pt"/>
</fo:block>
<fo:table>
<fo:table-column column-width="65pt"/>
<fo:table-column/>

<fo:table-header>
<fo:table-row height="14.4pt">
<fo:table-cell background-color="#CEDBF4" border-color="#FFFFFF" border-style="solid" border-width="0.25pt" display-align="center"
padding-left="5.4pt" padding-right="5.4pt">
<fo:block hyphenate="true" color="#000000" font-family="Arial, Helvetica" font-size="8pt" font-weight="bold" keep-with-next="always">
patient
</fo:block>
</fo:table-cell>
<fo:table-cell background-color="#CEDBF4" border-color="#FFFFFF" border-style="solid" border-width="0.25pt" display-align="center"
padding-left="5.4pt" padding-right="5.4pt">
<fo:block hyphenate="true" color="#000000" font-family="Arial, Helvetica" font-size="8pt" font-weight="bold" keep-with-next="always">
total Fee Value
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row height="14.4pt">
<fo:table-cell background-color="#E7EDFD" border-color="#FFFFFF" border-style="solid" border-width="0.25pt" display-align="center"
padding-left="5.4pt" padding-right="5.4pt">
<fo:block hyphenate="true" color="#000000" font-family="Arial, Helvetica" font-size="8pt">
100000000006 / / 32143214321 / DFSG
</fo:block>
</fo:table-cell>
<fo:table-cell background-color="#E7EDFD" border-color="#FFFFFF" border-style="solid" border-width="0.25pt" display-align="center"
padding-left="5.4pt" padding-right="5.4pt">
<fo:block text-align="right" hyphenate="true" color="#000000" font-family="Arial, Helvetica" font-size="8pt">
100.00&#160;UK Pound
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row height="14.4pt">
<fo:table-cell background-color="#E7EDFD" border-color="#FFFFFF" border-style="solid" border-width="0.25pt" display-align="center"
padding-left="5.4pt" padding-right="5.4pt">
<fo:block hyphenate="true" color="#000000" font-family="Arial, Helvetica" font-size="8pt">
100000000006 / 1 / 32143214321 / DFSG
</fo:block>
</fo:table-cell>
<fo:table-cell background-color="#E7EDFD" border-color="#FFFFFF" border-style="solid" border-width="0.25pt" display-align="center"
padding-left="5.4pt" padding-right="5.4pt">
<fo:block text-align="right" hyphenate="true" color="#000000" font-family="Arial, Helvetica" font-size="8pt">
100.00&#160;UK Pound
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>

</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>

enter image description here

最佳答案

也许在 <fo:table-column column-width="65pt"/> 65pt 宽度不够?

关于java - FOP 未在正斜杠上正确换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53086786/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com