Can I avoid a Page Break after some H1 headers but not all in PDF Export?


Version: Confluence 5.5.6 : 


I've searched the user guides/forums but cannot find a specific answer to this question, maybe someone else has come across this before: 

In some scenarios I have : 

H1  : Heading 


         Supplementary info 

         H2 : Sub Topic of H1 


In other scenarios I have : 

H1 Heading 

H2: Subtopic of H1 

H2: another Subtopic of H1


In scenario 1 -  I want there to be a page break before H2 however in scenario 2 I do not want there to be a page break as it results in one long empty page before h2 in the PDF export. Can I customize this using the PDF stylesheet? 


Similar queries that do not address this issue include:



2 answers

1 accepted

0 votes
Accepted answer

@Pamela Sheridan

I guess manually adding page breaks as described by Steven will be the easiest and most failure-proof solution for your case.

If you really want to try with an automatic solution search for "adjacent sibling combinator" and build something around h1+h2 { ... }



Hi Pamela,

have you already had a look at the Scroll PDF Exporter?

Using this you can either insert specific page-breaks on your Confluence pages directly (see Adding Pagebreaks), or generate multiple templates, one with pagebreaks before every H2 and one without any pagebreaks (see Enforcing Pagebreaks).

Does this help?


Thanks Nils! Yes , we don't have access to Scroll PDF exporter so I'm trying this using the CSS, my problem is the two scenarios above occur in the same document (its a very large document) so I need page breaks in some chapters but not in others (I've tried page-break : auto, left , right etc) ... Ill see if I can create a similar user macro to 'Disable Pagebreaks' that could be the possible solution - thanks for you suggestions and rapid response - really appreciated!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

482 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you