Skip to main content

Center and add page numbers to PDF files

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf_pagenum-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_pagenum-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file pdf_pagenum-0.1.1.tar.gz.

File metadata

  • Download URL: pdf_pagenum-0.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for pdf_pagenum-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f14bda110856e1d05b919022b803a9a54fd7697127dfab253f6f1ec3ee543249
MD5 b9a8e2cd5972db80023ae1aee646d006
BLAKE2b-256 b6c556263503fcc1a311a352b344d52c830f7e676be0f86331915bb85f67fa32

See more details on using hashes here.

File details

Details for the file pdf_pagenum-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pdf_pagenum-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for pdf_pagenum-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1177672a4b13f4d96a9998e50c07e38992770efa3da8c57c9e31c29653cff61
MD5 c3b02f00e8e4d474e6ae2ed538da0ff2
BLAKE2b-256 abce9e1b49a776c32c71045752f32c3cff00122259959153dfab346ed44b3010

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page