can't get page numbers on pdf export
Asked by Jeannette Lamb:

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!


Answers:
author: Steffen Heller
body: @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); }}
```

comments: author: Jeannette Lamb
body: This is the one that worked for me. Thank you!


author: Jeannette Lamb
body: 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.

comments: author: NotTheRealStephenSifersNOPENOPENOPENOPE
body: 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 {#toc-hId-1448162009}

1. Choose the**cog icon** ![](https://confluence.atlassian.com/download/attachments/157679812/Cog.png?version=1&modificationDate=1361250253653&api=v2), 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 {#toc-hId--1103994952}

1. Go to the space and choose **Space tools** \> **Look and Feel** on the sidebar. You'll need [Space Admin permissions](https://confluence.atlassian.com/display/DOC/Space+Administrators+and+their+Permissions) to do this.
2. Choose **PDF Stylesheet**.
3. Choose**Edit**.
4. Enter your customisations.


author: Erin Kelly
body: I can't get headers, footers, or page numbers working either. I am doing exactly this.


author: Steffen Heller
body: 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.


author: Erin Kelly
body: 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: " "; } }


author: NotTheRealStephenSifersNOPENOPENOPENOPE
body: Check out the following to do what you need:

[](https://confluence.atlassian.com/display/DOC/Customising+Exports+to+PDF)<https://confluence.atlassian.com/display/DOC/Customising+Exports+to+PDF>

### Page Numbering {#toc-hId-1448161986}

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);` `}` |