can't get page numbers on pdf export

I've followed the advice given by several prior post on this topic but I still get no page numbers in my pdf exports. I tried modifying the stylesheet only and also the stylesheet and pdf layout.

Can someone please guide me? It seems like a simple feature that should work easily. Otherwise I will have to purchase the Scroll PDF Exporter Plugin.

Thank you!

3 answers

1 accepted

@jnet:

Enter the following code at
"Browse > Space Admin > Look and Feel > PDF Stylesheet > PDF Export Stylesheet"

@page {
@bottom-right { 
content: counter(page) " / " counter(pages); 
}
}

This is the one that worked for me. Thank you!

0 vote
Stephen Sifers Community Champion Jul 17, 2014

Check out the following to do what you need:

https://confluence.atlassian.com/display/DOC/Customising+Exports+to+PDF

Page Numbering

To add page numbering, you need to combine customised HTML in the PDF Layout with customised CSS in the PDF Stylesheet.

  1. PDF Layout HTML: In the Footer section (or the Header section), use an empty span element with a unique ID, for example pageNum, to act as a place holder for the page number.

    HTML - PDF Layout: Footer Section
    <span id="pageNum"/>
  2. PDF Stylesheet CSS: Create the following CSS selector rule for the empty span:

    CSS - PDF Stylesheet
    #pageNum:before
    {
    content: counter(page);
    }

I tried this and it still doesn't work. I'm sure I must be doing something wrong. I think I will have to go with the plugin because it seems that without it I can only apply pdf export footers to an entire space. with the plugin, I can define different export templates per page type.

Stephen Sifers Community Champion Jul 17, 2014

Within the space you need to add the CSS entry and then export to PDF. You can make this change at the global level or within a space.

Setting a global PDF Stylesheet

  1. Choose the cog icon , then choose General Configuration under Confluence Administration.
  2. Choose Look and Feel > PDF Stylesheet. The following screen allows you to enter and save CSS code that will render content on each page.

Setting a space PDF stylesheet

  1. Go to the space and choose Space tools > Look and Feel on the sidebar. You'll need Space Admin permissions to do this.
  2. Choose PDF Stylesheet.
  3. Choose Edit.
  4. Enter your customisations.

I can't get headers, footers, or page numbers working either. I am doing exactly this.

Hi Erin, descriptions for header and footer can be found in the manual at: https://confluence.atlassian.com/conf54/confluence-user-s-guide/sharing-content/exporting-confluence-pages-and-spaces-to-other-formats/exporting-confluence-pages-and-spaces-to-pdf/customising-exports-to-pdf/advanced-pdf-export-customisations How to set up page numbers is explained above. If you follow this instructions and still have difficulties you should come back here and explain in detail what you did and what happened. Good luck.

I think I was following the instructions (I wanted to do the whole space so I was mainly looking at https://confluence.atlassian.com/conf54/confluence-user-s-guide/sharing-content/exporting-confluence-pages-and-spaces-to-other-formats/exporting-confluence-pages-and-spaces-to-pdf/customising-exports-to-pdf) but it must have been a conflict with some things in the stylesheet. I worked around it by using the @page option in the stylesheet to add page numbers on the bottom right and suppressing numbering on the first page with this: @page :first { @bottom-right { content: " "; } }

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

346 views 20 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you