How to create a page break function in Confluence to control pagination in PDF exports
This Knowledge Base article was written specifically for the Atlassian Server platform and may be self applied.
If you are an Atlassian Cloud customer this procedure cannot be performed due to application customization, which includes the creation of User Macros being unsupported: Functional differences in Confluence Cloud
Currently, Confluence does not have a Page Break function to control pagination in PDF exports.
An improvement request for this matter has been made: - CONF-28115Getting issue details... STATUS
Feel free to vote for it if you would like to see the request implemented in the future.
In the meantime, Confluence users with System Administrator permissions are able to create a custom user macro for the same purpose.
This article falls under the category of User Customization and is not supported by Atlassian.
Create A Custom User Macro:
- Go to "Configuration >> User Macros" in Confluence Administration
- Click "Create a User Macro"
- Enter the Macro Title field with a title that you will call this macro with
Fill the rest of the field as per described below. In this example, the macro will be named "pagebreak"FieldValue
Macro name pagebreak Visibility
Visible to all users in the Macro Browser
Macro Title pagebreak Description
Gives page break upon PDF export
Icon URL You can leave this field blank Documentation URL You can leave this field blank Macro body processing No macro body Template
Enter the code below in the template field.
<div style="page-break-before:always;"> </div>
- Click "Save"
For more information about creating your own user macros, go to the following documentation:
Calling the new pagebreak macro on the page:
Now you can add the macro to your Confluence page by typing the macro name inside curly brackets.
For example, if you have titled your macro as 'pagebreak', typing the following will automatically call the macro.
The macro should appear as so:
Upon exporting to PDF, page breaks will appear in the exported PDF where the macro is placed
Was this helpful?Yes Provide feedback about this article