How do I insert page breaks for PDF Export with the "new user experience"?
Asked by Michelle Oliveri:

Currently, I'm inserting page breaks using the div macro, but the div macro will be going away with the new user experience. What will replace the div macro? I just need something that allows me to add page breaks when exporting to PDF.


Answers:
author: James Renaud
body: If you wound up here like me, here's a good workaround for PDF exports that worked for me, with no macros, plugins, or other shenanigans.

1. In your confluence page, use the divider from the insert menu
2. In your PDF export CSS, the following will create a page break after each divider, and hide the divider from the doc while maintaining page break:

```
hr?{??page-break-after:always;??visibility:?hidden;??}?? 
```

comments: author: Lukasz Wierzbicki
body: Thank you so much for this tip! It worked like a charm! Exactly what I was looking for!


author: Berthyves Egersdorf
body: This is amazing! Thank you


author: Dave
body: This is great thanks so much!!


author: Crabtree, Carin
body: thanks James!!


author: Thiago Schmid
body: Thank you!

Just to clarify as of 2023 you need to go to:

Confluence Settings \> PDF Export \> click to edit PDF Stylesheet and add the code above.


author: Tatiana
body: Where can I find the divider in the instert menu?


author: Thiago Schmid
body: [@Tatiana](/t5/user/viewprofilepage/user-id/5310099) , on Confluence you can add it with /hr /divider or go to the top menu click on +, and select Divider.


author: Tatiana
body: Dear [@Thiago Schmid](/t5/user/viewprofilepage/user-id/1797806), unfortunately it dosn?t work: ![divider.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/282880i4EA2782986CDC6C7/image-size/large?v=v2&px=999 "divider.PNG")

do I need a pdf creator?


author: Thiago Schmid
body: Hey [@Tatiana](/t5/user/viewprofilepage/user-id/5310099) , it seems Atlassian translates the texts of all menus, so in your case it will be called **Trennlinie.**

Best,


author: Declan Shanaghy
body: Seems like you need to be a Space Admin to access "Confluence Settings \> PDF Export \> Edit PDF Stylesheet"

The PDF Export menu option does not appear for me, at least.


author: Konrad Wulf
body: Page breaks can be achieved with the regular HTML macro (no extra jira plugin needed) like this:

```
<div style="page-break-after:always;"></div>
```

so while editing the page it will look like this:

![html-macro-page-break-div.png](https://community.atlassian.com/t5/image/serverpage/image-id/209674iB09EEAD8F2B0E8B3/image-size/large?v=v2&px=999 "html-macro-page-break-div.png")


author: Michelle Oliveri
body: Hi Shannon,

The Div Macro can be found in the list of Macros under the "Formatting" category (if you're in the old/current editor). When I add "page-break-after;always;" to the Styles field, I get a nice little macro that I can copy and paste wherever I need a page break in my document (see below). When trying out the new experience, I noticed that the Div Macro is gone. I can't even copy and paste an old macro into the new experience. I'm hoping that something will be added to allow me to add page breaks to a document in a nice, easy way.

Warmest Regards,

Michelle

![Div Macro (3).png](https://community.atlassian.com/t5/image/serverpage/image-id/71194iB404FFACD8894119/image-size/large?v=v2&px=999 "Div Macro (3).png")

comments: author: Shannon S
body: Michelle,

Apologies; I see now which macros you're referring to. I've found further information on that Div macro. Essentially, that macro and others like it are part of the [Adaptavist Content Formatting Macros for Confluence](https://marketplace.atlassian.com/apps/247/content-formatting-macros-for-confluence?hosting=datacenter&tab=overview). Back in 2017, Adaptavist started charging for the add-on, and we started included a few of them to be bundled with Cloud.

At this time, they are being deprecated as part of the new editor, as mentioned here: [We're cleaning up the macro browser](https://confluence.atlassian.com/confcloud/we-re-cleaning-up-the-macro-browser-946028471.html).

Under **Other macros being deprecated**:
> The other macros listed here do get used, but their main use case is to make content look better and more readable, which is something we're now building into the editing experience as a default. As we're moving closer towards a WYSIWYG (what you see is what you get) editor, we also want to remove macros like this as they have the potential to break pages.

*
  > **Rollover**
*
  > **Div**
*
  > **Span**
*
  > **Style**
*
  > **JUnit Report**

We are tracking feedback on the removal on the threads below:

* [CONFCLOUD-65317](https://jira.atlassian.com/browse/CONFCLOUD-65317) *Macro removal feedback*
* [CONFCLOUD-65774](https://jira.atlassian.com/browse/CONFCLOUD-65774) *Div macros removal feedback*

Please let me know if you have any further questions about this.

Regards,

Shannon


author: Michelle Oliveri
body: Thanks, Shannon! I'll add my comment / request to the threads that you have mentioned. I appreciate your help!


author: Shannon S
body: Hello Michelle,

Thank you for contacting us about this. I'm not really sure which macro you're referring to, as there's no Div Macro included in Confluence. Could you show me which macro you are currently using for this?

To include page breaks between each new page, you can use the workaround below:

* [Customize Exports to PDF \> Page Breaks](https://confluence.atlassian.com/confcloud/customise-exports-to-pdf-724764825.html#CustomizeExportstoPDF-PageBreaks)

> By default, Confluence pages are exported without page breaks, so that shorter pages will appear on the same PDF page.
>
To make each Confluence page appear on a separate page in the PDF file, add the following rule in the PDF Stylesheet:  
> CSS - PDF STYLESHEET
>
>     .pagetitle{page-break-before: always;}

As for being able to include a page break on-demand, there's a feature request below for this:

* [CONFCLOUD-36146](https://jira.atlassian.com/browse/CONFCLOUD-36146) *Provide ability for OnDemand users to insert page breaks to have a clean pdf export*

Please vote on it to show you're interested, and you'll be included on any future updates.

Let me know if you have any questions about this.

Regards,

Shannon


Tags: cloud

confluence-cloud