FOP-文本到XML到PDF [英] FOP - Text to XML to PDF

查看:201
本文介绍了FOP-文本到XML到PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!

有谁知道如何通过FOP将格式化的文本转换为PDF?我正在尝试查找错误,并且对FOP不太了解.

我有多个段落中的虚拟文字,例如:

Hey!

Does anyone know how to get formatted text via FOP into the PDF? I''m trying to find a bug and have not much of a clue about FOP.

I have a dummy text out of multiple paragraphs like:

Li Europan lingues es membres del sam familie.

Lor separat existentie es un myth.

Por scientie, musica, sport etc, litot Europa usa li sam vocabular.

Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules.

Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores.


和我的输出看起来像:


and my output looks like:

Li Europan lingues es membres del sam
familie.    Lor separat existentie es un myth.    Por scientie, musica, sport etc,
litot Europa usa li sam vocabular.    Li lingues differe solmen in li grammatica, li
pronunciation e li plu commun vocabules.    Omnicos directe al desirabilite de un nov
lingua franca: On refusa continuar payar custosi traductores.    At solmen va esser necessi
far uniform grammatica, pronunciation e plu sommun paroles.    Ma quande lingues coalesce,
li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent
lingues.    Li nov lingua franca va esser plu simplic e regulari quam li existent Europan
lingues.    It va esser tam simplic quam Occidental in fact, it va esser Occidental.    A
un Angleso it va semblar



您可以清楚地看到链接断开丢失.

我的XSLT 看起来像这样:



You can see clearly that the linke breaks are missing.

my XSLT looks like this:

<xsl:template name="Body">
	<fo:flow flow-name="xsl-region-body">
	<fo:block 

		xsl:use-attribute-sets="body-font" 

		margin-left="2pt" 

		margin-right="2pt"

	>
		<fo:block font-size="80%" white-space-collapse="false">
			<xsl:value-of select="text" /> 
		</fo:block>
	</fo:block>
		<fo:block id="endofdoc" />
	</fo:flow>
</xsl:template>



为什么我没有换行?



Why don''t I get the line breaks? do I have to modify the text first(HTML style) to get the paragraphs?

推荐答案

将您的问题发布到FOP邮件列表中:
http://xmlgraphics.apache.org/fop/maillist.html [
Post your question at the FOP mailing list:
http://xmlgraphics.apache.org/fop/maillist.html[^]

You''re more likely to get a good reply there.

Best regards
Espen Harlinn


<fo:block font-size="80%" linefeed-treatment="preserve">
   <xsl:value-of select="text" />
</fo:block>



linefeed-treatment="preserve"可以解决问题.



the linefeed-treatment="preserve" does the trick.


这篇关于FOP-文本到XML到PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆