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

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

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