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

Several Issues with PDF Stylesheet Output for Confluence 4.3

I have been trying to edit the PDF export stylesheet, and have run across several issues that I think may be bugs. I'm able to change certain elements of the styles (such as font color) and these render correctly, but even in consultation with our resident CSS guru, we have not been able to resolve the following:

1) Side bar content renders on consecutive pages, rather than as a sidebar on the page.

For example, if I have a page with two Info panel elements in the right sidebar, when this is exported to PDF, the original page will print, followed by two pages that print each info panel on a separate page on the left. If the side bar contains just paragraph copy, this will be printed below all the other content on the page, rather than in the sidebar. We suspect that this is a problem with the sidebar definition (if it exists) in the rendering engine.

2) I have attempted to remove the numbers that precede each chapter/section in the TOC by removing this CSS style:

content: target-counter(attr(href), page);

However, when I remove it, the numbers are still there.

3) The h1.pagetitle style rule is not being rendered correctly.

Specifically, page-break-before: always is not being observed. I'm actually not sure if the correct element is h1.pagetitle or h1.pagename, but I want to have each new topic appear on a new page, and I assumed that one of these would be the correct style. However, since the rendering engine decreases the heading number for each level of hierarchy, I'm not sure if I should create new h2, h3, etc. pagename/title styles, or if there is something awry with the h1.pagetitle style. I tried increasing the h1.pagetitle and h1.pagename to be huge (48 point), and since this didn't render, I am assuming that something is wrong with the rendering image.

Assistance would be most appreciated, since eventually I do need to create PDF customer docs, and what I'm getting so far is not ready for prime time.

5 answers

I would like to get back to question no1 from Phil:

What is the policy for the export of page layouts? If a page layout with different colums is used should the column structure be preserved in PDF output? Or is the standard setting that the columns are rendered underneath each other?

In my pages the columns are underneath each other. Can I change this?

Following the various bugs in Jira, it seems that there are many people having substantial problems with the PDF export functionality. Since some of our vendors require us to submit PDF versions of our documentation as part of the bid process, the inability to provide clean copy poses a risk to our bottom line. I've escalated this to Atlassian and commented on the relevant Jira bugs, but so far, no action or response. If anyone else is having problems with overrides of their custom stylesheets or inability to render styled content correctly, I urge you to comment and vote on this bug:


1) no idea, sorry

2) Check my answer to Matthew at

3) There is a

h1.pagetitle {
    page-break-before: always; }

in the confluencedefaultpdf.css.

If I check the confluence page's html source code the h1.pagetitle corresponds to the pages main headline. In other words: If you export a set of different confluence pages into one PDF file then every new confluence page should create a pagebreak (because of this h1.pagetitle that the page starts with).

This is probably NOT what you are looking for. You talk about "new topics" and I don't fully understand what you mean by that. If it means that you have different paragraphs of text on ONE confluence page and you want these paragraphs to create a pagebreak in the resulting PDF then you must define some new css code for this. But this is tricky!

Basically, code like

h1, h2, h3 {
page-break-before: always; }

would create pagebreaks for all h1, h2, h3 elements. But I never managed to find the right combination of headings that works for all my file. I always got documents with either too many or too few pagebreaks. And the fact that a h1 on the confluence page can turn into anything between h2 and h10 dependant on what level of hierarchy the page is in doesn't make it easier!

In short: I think I can understand your problem but I don't have a real solution.

Nine months later and I'm still unable to resolve these issues. I just installed a trial version of K15's PDF Exporter plugin, set up a template, and when I exported - nothing. None of the template settings for that space were expressed in the output. I also tried to update the space CSS to with what appears to be a fix for the excerpt-macro formatting bug described here: but it also won't "take." Can someone from Atlassian please tell me what the problem is, or in what version it is corrected, because I have a serious need to output professional quality customer documentation.

Hey Phil,
I share your frustrations! Did you try K15t s support? They have been EXTREMELY responsive with us! (We got their Scroll HTML export.)

I tried to do the opposite to your #2. Somehow I got this crazy idea: If you got heading numbering in the TOC you should have it in the body too.

I opened a support ticket (because of the deafening silence on Answers) and believe me, I ll have this solved! <argh>

I am having the same issues as you mention in #2) Unable to remove chapter from title page and #3) unable to have page breaks consistently work.

I performed the changes found on the Atlassian site for dynamic formatting of the title page and the number does not get removed.

For the pagebreaks, I created a pagebreak macro as mentioned at It works sometime but not always and I can't determine why its so inconsistent.

Has anyone else had these issues and found a way to address them? We are using Confluence v5.4.1

Suggest an answer

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

What's New in Confluence Cloud – June 2020 Edition

Ready for the monthly rollup of what happened in May for Confluence Cloud? Improved mobile login experience (& SSO) For those of you with the Confluence mobile app, we know the login experien...

27,633 views 41 90
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