It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Add total number of pages in the bottom-of-page of a PDF export ?

I want to add "page 3 of 143" at the bottom of the page.

It's ok for "page 3" with

but I cannot find the total number.

4 answers

1 accepted

3 votes
Answer accepted

The total number of pages is retrieved with "counter(pages)". Thus "page 3 of 143" translates as

content: "page " counter(page) " of " counter(pages);

Works on Atlassian Confluence 3.3.3. Thanks a lot !

Thanks! Works for me :)

Nice :D

Thx a lot!

Thanks a lot!!!!

Confluence 1000.0.0

It does not work.

The page number is inserted with CSS counters. As far as I know there is no possibility to count all pages in CSS. So there is no chance for you to the the total page number in dhe PDF...

content: "page " counter(page) " of " counter(pages); this one Generate like this page 1 of 0 . it will not come  total pages count can you suggest anything for total pages 

What did you do exactly? Where did you enter the above code? Where is the text supposed to appear?

In short: This is CSS code. It must be entered in the PDF stylesheet and will create text in a PDF when the wiki page is exported via "Export to PDF".

in Dompdf inside a <style>#pagenumber:before {
content: "Page " counter(page) " of " counter(pages);


I call the id inside the body

<body><span id="pagenumber"></span>


the Output come like Page 1/0

The solution proposed here, works as follows:

  1. Add the following code at Browse > Space Admin > PDF stylesheet
    @page {
    @bottom-right {
    content: counter(page) " / " counter(pages);
  2. Click Tools > Export to PDF

The result will be a PDF with the page number(s) "x / x" at the bottom right of your PDF file.

You seem to try something different which I am not familiar with. So I can't help with that.

image.PNGi marked round in picture that header side i need  so i can use  inside a style as a ID    


content: counter(page) " / " counter(pages);
<div id="id"></div>

this will work or not ?

it will not work i checked any other option for that to print in pdf  -> page no./total page count 

any solution?

Like # people like this


Out put showing like this. Total pages is 2 but showing 0.Please help me thanks to all

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What project did you transition or start on Confluence with the shift to remote work?

It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...

294 views 9 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you