Clioos › Guides › Add Page Numbers
How to Add Page Numbers to a PDF
The free offline way is an overlay stamp: draw “Page N of M” on a blank page with ReportLab, then merge that overlay onto each real page with pypdf. Tested 2 November 2026 with pypdf 6.21.4 and ReportLab 5.1.0 — a 2-page PDF became a 2-page, 1,949-byte PDF stamped “Page 1 of 2” and “Page 2 of 2”, and pdftotext read both stamps back. That last check matters: the stamps are real, selectable PDF text, not burnt-in images. Clioos does not offer a page-numbering tool — this guide teaches the method.
At a glance
- Clioos has no page-numbering tool. The method below runs on your own computer with free, open-source pypdf and ReportLab — no upload, no account.
- Stamps are real text: pdftotext extracted “Page 1 of 2” and “Page 2 of 2” from the test output, so the numbers are searchable and selectable.
- Stamp position in the test: centred at the bottom, 36 points from the bottom edge. Move it if the page already has a footer there.
- The original file is untouched: the script reads it and writes a new file. Keep the original until you have checked the output.
Steps
- Install both libraries:
pip install pypdf reportlab(pypdf 6.21.4, ReportLab 5.1.0 in the test). - For each page i of N, build an overlay canvas at the page size and draw
Page i of Ncentred at the bottom (36 points up in the test). - Merge with
page.merge_page(overlay), add the page to a PdfWriter, and write numbered.pdf. - Verify: the test input (2 pages) became numbered.pdf, 2 pages, 1,949 bytes — and pdftotext returned “Page 1 of 2” and “Page 2 of 2”. If a stamp is missing, the merge step for that page did not run.
Worked example (tested 2 November 2026)
Test input: a 2-page text PDF. Method: ReportLab overlay + pypdf merge_page, stamp centred 36 points from the bottom edge.
| File | Detail |
|---|---|
| sample-text.pdf (input) | 2 pages, no numbers |
| numbered.pdf (output) | 2 pages, 1,949 bytes, stamped “Page 1 of 2” and “Page 2 of 2” |
| Verification | pdftotext extracted both stamps — the numbers are real text, not images |
Page count did not change: stamping adds a text layer to existing pages, it does not add pages.
What it can't do
- No Clioos tool for this: Clioos does not offer page numbering. The method above is the free offline route.
- Stamps can collide with existing footers: if a page already has footer text at the same spot, the stamp will overlap it. Move the stamp or shrink it for such pages.
- PDF pages, not book pages: the stamp counts PDF pages from 1. A document with a cover and front matter needs custom numbering if the printed page numbers should differ.
- Scanned pages still get stamps, but nothing else changes: the stamp is a new text layer; the scanned image underneath stays an image, and its own text is still not searchable.
Frequently asked questions
Is it free to add page numbers to a PDF?
Yes, with pypdf and ReportLab — free and open source, no per-file charge.
Are the stamped numbers searchable?
Yes. In the test, pdftotext extracted “Page 1 of 2” and “Page 2 of 2” — the stamps are real PDF text.
Will stamping change my page count?
No. Each stamp merges onto an existing page; the test went from 2 pages to 2 pages.
Can I start numbering at a different number?
Yes — draw whatever text you want on the overlay (for example “Page 5” on the first stamped page). The script controls the text, not the tool.
Related guides: How to convert PDF to text · How to edit a PDF · How to merge PDF files · All guides · Tool: PDF Probe