Forums

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

Keeping images with previous in PDF exports

Tom Crowley
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.
July 10, 2019

Hi,

When I export my space to PDF in Confluence Cloud, my images do not always fit on the same page as the content before them, and so are exported onto the following page as the first item. 

I want the paragraph immediately before the image to always be on the same page as the image.

I've tried to set this up in the PDF Stylesheet, but to no avail.

I have tried the following (both with and without `!important`):

.confluence-embedded-file-wrapper {
page-break-before: avoid !important;
}

and

.confluence-embedded-image {
page-break-before: avoid !important;
}

However, neither work.

Is this not supported? Or am I doing something wrong?

Any guidance is much appreciated.

 

Cheers,

 

Tom

1 answer

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2019

Hello there Tom!

Using only CSS styling I believe that this is not achievable. However, we can manually insert a Page Break by using the following User Macro:

## @noparams
<div style="page-break-before:always;"></div>

To create a user macro, we can do the following:

  1. Click the Cog Icon at the top right cornet
  2. Select General Configuration
  3. Search for User Macros in the left side menu
  4. Click to Create a User Macro
  5. Under Macro Name type page-break
  6. Under Visibility select "Visible to all users in the Macro Browser"
  7. Under Macro Title type Pagebreak
  8. You can leave Description, Categories, Icon URL, Documentation URL all as is
  9. Under Macro Body Processing select No macro body
  10. Under the Template text box, paste the code in the excerpt above
  11. Save

After we create this macro, all we need to do is insert it before the paragraph that precedes the image and it should appear in the same page as the image.

Let us hear from you Tom. Looking forward to your reply!

Tom Crowley
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.
July 16, 2019

I was under the impression you couldn't create your own macros in Confluence Cloud. I can't see a cog icon in the top right-hand corner. The cog icon (Settings) in the left-hand sidebar does have a General Configuration option, but this has no option for User Macros.

If you could let me know exactly how to find this page, that would be helpful, although it sounds like a lot of effort to set the macro in the middle of an ordered list for several images...

Thanks

Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2019

Hello there, thanks for keeping the thread moving.

You are correct, Tom. User macros are only available for Confluence server.

According to our documentation, this is not possible in Confluence Cloud:

Here we can have a better look at the differences between Cloud and Server:

Looking through our reports, I could find this:

This report points directly to the feature needed in your case. You can vote and watch this report. Votes increase the report visibility and watching keeps you up to date.

Let us hear from you, Tom!

 

Tom Crowley
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.
August 21, 2019

Created: 19-Jul-2012 3h49 PM

You'll forgive me for not believing that Confluence have any inclination to add this feature, and that as for watching it, I might as well watch paint dry.

Dee Elling
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2022

and.... the paint is still drying. 

Like Nejc Skale likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events