How to create a page break function in Confluence to control pagination in PDF exports
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
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-28115 - Getting 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"
FieldValueMacro name pagebreak Visibility Visible to all users in the Macro Browser
Macro Title pagebreak Description Gives page break upon PDF export
Categories Confluence Content
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.
## @noparams
<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.
{pagebreak}
The macro should appear as so:
Upon exporting to PDF, page breaks will appear in the exported PDF where the macro is placed