Search code examples
xsltapache-fop

Apache-FOP line break


XML to PDF conversion using Apache FOP, how to insert line break between lines.

am trying all the possibilities with the below code.

<fo:block>
    Line 1 &#xA;   /// Not Working
    Line 2 &#xA;   /// Not Working
    Line 3 <br />  /// Not working
</fo:block> 

Solution

  • If you want insert line break inside <fo:block/>. inserting <fo:block/> instead of &#x0A; will also work like <br/> in HTML.

    <fo:block>
        Line 1 <fo:block/>
        Line 2 <fo:block/>
        Line 3 <fo:block/>
    </fo:block>