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.
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!
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...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.