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

2 votes
Accepted answer


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!

Check out the following to do what you need:

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
    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.

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: 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 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
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

803 views 38 5
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