can't get page numbers on pdf export

Jeannette Lamb
Contributor
July 17, 2014

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

3 votes
Answer accepted
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 20, 2014

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

Jeannette Lamb
Contributor
July 20, 2014

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

0 votes
Jeannette Lamb
Contributor
July 17, 2014

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.

NotTheRealStephenSifersNOPENOPENOPENOPE
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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.
Erin Kelly November 17, 2015

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

Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2015

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.

Erin Kelly November 19, 2015

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: " "; } }

0 votes
NotTheRealStephenSifersNOPENOPENOPENOPE
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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);
    }

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events