Skip to main content

pdf-pagenum

Center page number annotations in PDF files. Repositions FreeText annotations added by macOS Preview's text function, or adds new page numbers to pages that don't have them.

Features

  • Reposition mode: find existing page number annotations and center them at the bottom of each page
  • Add mode: create new page numbers on specified pages with --add
  • Start offset: begin numbering from any page with --start N
  • Smart placement: auto-detects body content boundaries, places page numbers below content with proper margins
  • Preserves A4 dimensions: never modifies page size, accepts content overlap on tight pages
  • Landscape aware: handles both portrait and landscape orientations correctly
  • White background: page numbers have a white fill to stay readable over images

Install

pip install pdf-pagenum

Usage

# Reposition existing page numbers
pdf-pagenum ./input_folder/ ./output_folder/

# Add page numbers to all pages (starting from 1)
pdf-pagenum ./input_folder/ ./output_folder/ --add all

# Add page numbers starting from 5
pdf-pagenum ./input_folder/ ./output_folder/ --add all --start 5

# Add page numbers to pages 3 through 7 only
pdf-pagenum ./input_folder/ ./output_folder/ --add 3-7

# Add page numbers to pages 1, 3, 5, 6, 7
pdf-pagenum ./input_folder/ ./output_folder/ --add 1,3,5-7 --start 10

Requirements

  • Python >= 3.9
  • PyMuPDF >= 1.23.0
  • natsort >= 8.0.0

License

MIT

Metadata

Release files for pdf-pagenum 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pdf-pagenum 0.1.1
File Size Uploaded
pdf_pagenum-0.1.1.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pdf-pagenum 0.1.1
File Interpreter ABI Platform
pdf_pagenum-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / pdf_pagenum-0.1.1.tar.gz

Download URL pdf_pagenum-0.1.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f14bda110856e1d05b919022b803a9a54fd7697127dfab253f6f1ec3ee543249
BLAKE2b-256 checksum
How to use checksums
b6c556263503fcc1a311a352b344d52c830f7e676be0f86331915bb85f67fa32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / pdf_pagenum-0.1.1-py3-none-any.whl

Download URL pdf_pagenum-0.1.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1177672a4b13f4d96a9998e50c07e38992770efa3da8c57c9e31c29653cff61
BLAKE2b-256 checksum
How to use checksums
abce9e1b49a776c32c71045752f32c3cff00122259959153dfab346ed44b3010
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page