使用FOP保留生成PDF中的空格
问题描述:
我正在实施FOP
使用XSLT
和XML
文件,我希望保留单词之间的空格。
这是我XML
看起来像:使用FOP保留生成PDF中的空格
<lines>
<line1> My Creation </line1>
<line2> address one AAAAAAAAAAA</line2>
<line3> This is the address of creation</line3>
<lines>
以下是在PDF
形式的结果:
My Creation
address one AAAAAAAAAAA
This is address of creation
但我需要它是这样的:
My Creation
address one AAAAAAAAAAA
This is the address of creation
因此保留所有空间。 我用下面一行:
<xsl:preserve-space elements="*"/>
,但无济于事。
我搜索解决方案但徒劳无功。
任何帮助,将不胜感激。
答
<fo:block font-family="monospace" white-space="pre" text-align="left">
<xsl:value-of select="." />
</fo:block>
-
white-space="pre"
将保留空格 -
font-family="monospace"
将关于 尺寸到人物的均衡空间
[XSL转换后,保留空白的PDF]的可能重复(http://*.com/questions/10320622/preserving-whitespace-in-pdf-after-xsl-transform) – 2012-08-07 05:54:43