This is the documentation for an older version of Scroll PDF Exporter. Here you can view the most up-to-date version of the Scroll PDF Exporter documentation.

Controlling the Text-Alignment

In Confluence, you can right, left, center align or justify text. If you want to use multiple alignments for text that is part of a paragraph, you have to use a User Macro. It tells the exporter which content to align different from the style set in the exporters template.

If you dont know how to write user macros, please see: Background: Writing User Macros.

Note

This is just a workaround, unless EXP-476 is fixed.

To create the user macro:

  1. Click the cog icon at top right of the screen and select Confluence Admin.
    The Administration Console is displayed.
  2. In the Configuration section, click User Macros.
    The screen User Macros is displayed.
  3. Click Create a User Macro.
  4. Enter a Macro Name.
  5. Activate the option Visible to all users in the Macro Browser.
  6. Enter a Macro Title.
  7. (Optional) enter a Description.
  8. Select Confluence Content in the drop-down Categories.
  9. (Optional) enter an Icon URL.
  10. Enter the URL of this page in the field Documentation URL.
  11. Activate the option MacroBody Processing Rendered.
  12. Depending on the macro alignment, replace the code in the field Template with the following code:

    Right Alignment
    ## @noparams 
    
    <p class="scroll-right-aligned" style="text-align: right">$body</p> 
    Center Alignment
    ## @noparams 
    
    <p class="scroll-center-aligned" style="text-align: center">$body</p> 
    Justified
    ## @noparams 
    
    <p class="scroll-justified" style="text-align: justify">$body</p> 
  13. Click Save.
    The macro is now saved and must be defined in the template.

To define the macro in the template:

  1. Open your template and click Content Formatting.
  2. Depending on the macro alignment, enter the following code at the end of the CSS:

    Right Alignment
    p.scroll-right-aligned { 
    text-align: right; 
    } 
    Center Alignment
    p.scroll-center-aligned { 
    text-align: center; 
    } 
    Justified
    p.scroll-justified { 
    text-align: justify; 
    } 
  3. Click Save.
    The macro is defined in the template and the content will be exported in the wanted alignment.
  4. To use the macro, enter  '{macro-name' and enter the content.

    Please make sure to insert every content paragraph in a seperate macro. If you have multiple paragraphs in the same macro-body, the alignment will not be rendered correctly.