More Resources
Table of Contents
More Resources
Editing Spacing
Text Spacing
Customize your PDF by modifying the spacing between paragraphs and lists in your PDF output.
Editing Paragraph Spacing
Edit the various spacings regarding paragraphs in your custom PDF output.
Editing List Spacing
Edit the various spacings regarding lists and list items in your custom PDF output.
Text Spacing

Customize your PDF by modifying the spacing between paragraphs and lists in your PDF output.
You can modify text spacing in your PDFs to improve readability and create hierarchy between text. You can modify text spacing by Editing Paragraph Spacing or Editing List Spacing.
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.

Editing List Spacing

Edit the various spacings regarding lists and list items in your custom PDF output.
You have the custom-attrs.xsl file (located in cfg/fo/attrs/) open and want to edit list spacing. This procedure uses examples for unordered lists, however, you can do the same thing for ordered lists.

  1. You need to get the default list 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="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 5mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
    < /xsl:attribute-set> 
    
    < xsl:attribute-set name="ul.li"> 
      < xsl:attribute name="space-after"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="space-before"> 1.5pt< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  2. You can add whatever attributes you want here. Start by adjusting the space before and after the individual list items. So, you’ll modify the “ul.li” attribute set by adding some padding attributes:

    Step Information
    < xsl:attribute-set name="ul.li"> 
      < xsl:attribute name="space-after"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="space-before"> 1.5pt< /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 list items, you can also adjust the spacing before and after the entire list elements. You can use the padding attributes here as well (on the “ul” attribute set):

    Step Information
    < xsl:attribute-set name="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 5mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
      < xsl:attribute name="padding-top"> 10px< /xsl:attribute> 
      < xsl:attribute name="padding-bottom"> 10px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  4. Using the existing “provisional-distance-between-starts” attribute (in the “ul” attribute set) you can adjust how much space there is between the bullet and the start of the text:

    Step Information
    < xsl:attribute-set name="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 15mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  5. You can adjust the distance between the page margin and the bullet by adjusting the “margin-left” attribute on the “ul” attribute set.

    Step Information
    < xsl:attribute-set name="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 5mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
      < xsl:attribute name="margin-left"> 20px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  6. You can also adjust the line-height of the list item text content (as explained in Editing Paragraph Spacing). However, be careful because this will also adjust the spacing between list items (the same as adjusting padding-bottom): 

    Step Information
    < xsl:attribute-set name="ul.li"> 
      < xsl:attribute name="space-after"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="space-before"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="line-height"> 15px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

You modified the list spacing in your PDF output.