How to insert line breaks in a PDF generated with XSL-FO

断了今生、忘了曾经 提交于 2019-12-04 14:03:46

It should work with the following xml (you should add all the attributes):

<xsl:template match="AddCmt">
    <fo:block keep-together="always"> Additional Comments 
        <fo:block-container border-style="solid" height="20mm" width="170mm" space-after="5mm"> 
            <fo:block wrap-option="wrap" linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="preserve"> 
                <xsl:attribute name="id"> 
                    <xsl:value-of select="../CMT_ID"/> 
                </xsl:attribute> 
                <xsl:value-of select="../ANS_CMT"/> 
            </fo:block> 
        </fo:block-container> 
    </fo:block> 
</xsl:template> 

But as I mentioned in the comments, if your XML already has no linebreaks, there's no way your PDF will. You mentioned in your question there are no linebreaks in your XML, hence no linebreaks in the PDF.

Try checking out why there are no linebreaks in the XML. If you can provide any more information (a piece of your XML, the code you use to construct the XML, ...), please edit your answer and add the information.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!