Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep info macro from splitting when there is a page break in PDF?

Salla February 11, 2019

Has anyone been able to fix this issue via CSS? The comments suggest the following, but it's not working:

.confluence-information-macro {
    page-break-inside: avoid !important;
}

 This one works, but when I use it, it inserts page breaks in too many places:

@media print {
div {
page-break-inside: avoid;
}
}

Macros don't break if a single page is exported, but some of them are split into two pages if I export the whole space. 

2 answers

1 vote
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 15, 2019

Hello Salla,

The feature request you have linked is reported as “Won’t do” due to limited demand. With this said, you do have additional options for PDF exports within the Atlassian Marketplace. While you may be able to resolve this in the short term via CSS for export, that CSS stylesheet may not apply to new versions in the future. With this said, the marketplace does have two products which may assist in resolving your issue. Here are the two add-ons which I discovered (in alphabetical order);

  1. Content Exporter (Word, PDF, HTML)
  2. Scroll PDF Exporter for Confluence

I would suggest you try the above add-ons within a developer instance of Confluence. This will allow you to ensure you no longer have a page break issue.

If neither of these solutions works, please let us know.

Regards,
Stephen Sifers

0 votes
Nils Bier _K15t_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2019

Hi @Salla

I assume you're running into this behavior: https://k15t.jira.com/browse/EXP-528 ? This is a limitation of the library that's used to create PDFs from the default PDF functionality from within Confluence (Flying Saucer).

As @Stephen Sifers already suggested, you could have a look at our Scroll PDF Exporter, which allows you to create perfectly styled templates without the need to code a single line of CSS, using our graphical template designer (you can check out a short video giving an overview about the app here).

We're also using another library to generate our PDFs, so this issue does not occur when creating an export using our Scroll PDF Exporter.

Please feel free to trial the app using a free 30 day trial license, and get in touch with us via support@k15t.com if you have any product-related questions.

Cheers,
Nils

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events