Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Add Page Numbers to the Table of Contents in Confluence PDF Export v2?

Ray Mackaaij
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 18, 2025

Hi everyone,

I'm trying to add page numbers to the table of contents (TOC) in a Confluence PDF export:

div.toc a::after { content: leader('.') target-counter(attr(href), page); }

However, I’ve noticed that in PDF Export v2, these CSS properties (target-counter() and leader()) are no longer supported. This means that automatic page numbering in the TOC no longer works in the exported PDF.

My question:
Is there another way to add page numbers to the TOC in Confluence's PDF export system?

1 answer

1 accepted

5 votes
Answer accepted
Barbara Szczesniak
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.
February 18, 2025

@Ray Mackaaij Welcome to the Atlassian Community.

I haven't had a need to generate a PDF from Confluence for a while, but I just tried it, and my TOC has page numbers.

My settings:

  • Space Settings > Look and feel > PDF Export: I have nothing in any of these settings
  • Space Settings > General > Export Space > select PDF:
    ExportPDFOptions.png

To me, that indicates that something in the PDF Export settings is causing the page numbers to not appear in the output.

Ray Mackaaij
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2025

Hi Barbara,

Thanks for your reply! I didn’t realize there’s an export option within the space. I had been using the one on the page itself, accessed through the three dots.

Now I can see the table of contents with page numbers, which is really useful. However, I’m having trouble customizing the layout through CSS in the PDF stylesheet to fit my needs.

Have you worked with this before? Any advice would be greatly appreciated!

Barbara Szczesniak
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.
February 20, 2025

@Ray Mackaaij No, I don't really make PDFs from Confluence. We decided to use the Scroll Viewport app to publish our content to a website accessible by our readers. I can publish an update of the documentation following our sprint/release schedule.

Like Ray Mackaaij likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events