It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Problem with Header & Footer in single page PDF export

Hello guys! I am trying to customize my CSS for single page PDF export for days now - I am almost happy with the result as of now. The only problem: I'd like to add a margin to the exported PDFs text body that doesn't affect the header & footer. Somehow that does not seem to work as I alsways end up with a 1 cm margin at the right side of my header & footer. So far I tried all sorts of things yet don't get it to work. It's not a major issue yet bugs me a lot. Any chance you have a solution for me?

 

Attachment: A PDF I exported a few minutes ago for you to see what I mean.

250

 

Here's the CSS:

@page { size: 210mm 297mm; font-family: OpenSans, Helvetica, Arial, sans-serif; margin-top: 2,5cm; margin-bottom: 1,5cm; word-wrap: break-word; page-break-before: always; margin-right: 0cm; margin-left: 0cm;

@top-center { content: "Meyle+Müller GmbH + Co. KG"; font-family: OpenSans, Helvetica, Arial, sans-serif; font-weight: bold; color: white; font-size: 10pt; background-color: #979797; width: 100%; align: center; margin-right: -1cm; }

@bottom-left { content: "Exportiert aus Confluence"; text-align: center; font-family: OpenSans, Helvetica, Arial, sans-serif; color: white; background-color: #979797; font-size: 7pt; }

@bottom-center { content: counter(page) " von " counter(pages); text-align: center; font-family: OpenSans, Helvetica, Arial, sans-serif; color: white; background-color: #979797; font-size: 7pt; }

@bottom-right { content: "© Meyle+Müller GmbH + Co. KG"; text-align: center; font-family: OpenSans, Helvetica, Arial, sans-serif; color: white; background-color: #979797; font-size: 7pt; } }

 

Thank you for your suggestions!

2 answers

I don't know why, but your method really doesn't work. If you are ready for a stupid workaround you can do the following:

Define the background-color as a single-colored background-image of @page.

@page {  
size: 210mm 297mm;
background-image: url(/download/attachments/.../name_of_that_image.png);  
background-repeat: repeat-x;  
margin-top: 3cm; /* should be the same height as the background-image */

@top-center { 
content: "Meyle+Müller GmbH + Co. KG";
}
}

Where do you put this CSS? I tried putting some in global and within the space but that only works if I export multiple pages not with a single page...

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Confluence Server & Data Center 7.0 is here!

Hello Community 👋🏼 I’m Makisa, a product manager on Confluence Server and Data Center. Confluence Server & Data Center 7.0, our latest platform release, is now available and we wanted to shar...

157 views 0 11
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you