More Resources
Table of Contents
More Resources
Editing Paragraph Spacing

Edit the various spacings regarding paragraphs in your custom PDF output.
You have the custom-attrs.xsl file (located in cfg/fo/attrs/) open and want to modify the paragraph spacing.

  1. You need to get the default paragraph styling so that you can modify it. The default attribute-set is displayed below, as well as a screenshot of the default styling.

    Step Information
    < xsl:attribute-set name="p" use-attribute-sets="common.block"> 
    	< xsl:attribute name="text-indent"> 0em< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  2. Now, you can add whatever attributes you want here. Start by adjusting the space before and after paragraph elements. This is set by the padding attributes:

    Step Information
    < xsl:attribute-set name="p" use-attribute-sets="common.block"> 
    	< xsl:attribute name="text-indent"> 0em< /xsl:attribute> 
    	< xsl:attribute name="padding-top"> 10px< /xsl:attribute> 
    	< xsl:attribute name="padding-bottom"> 10px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  3. In addition to adding space between paragraphs, you can also adjust the spacing between each line of the paragraph by setting the line height attribute:

    Step Information
    < xsl:attribute-set name="p" use-attribute-sets="common.block"> 
    	< xsl:attribute name="text-indent"> 0em< /xsl:attribute> 
    	< xsl:attribute name="padding-top"> 10px< /xsl:attribute> 
    	< xsl:attribute name="padding-bottom"> 10px< /xsl:attribute> 
    	< xsl:attribute name="line-height"> 20px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  4. Finally, you can adjust the text alignment of the paragraphs:

    Step Information
    < xsl:attribute-set name="p" use-attribute-sets="common.block"> 
    	< xsl:attribute name="text-indent"> 0em< /xsl:attribute> 
    	< xsl:attribute name="padding-top"> 10px< /xsl:attribute> 
    	< xsl:attribute name="padding-bottom"> 10px< /xsl:attribute> 
    	< xsl:attribute name="line-height"> 20px< /xsl:attribute> 
    	< xsl:attribute name="text-align"> justify< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

You modified the paragraph spacing for your PDF output. Feel free to try more attributes and values based on CSS styling.