Skip to main content

A powerful Python library and CLI for PDF processing.

Project description

Ultimate PDF

A powerful, dependency-light Python CLI for everyday PDF tasks — merge, split, compress, rotate, encrypt/decrypt, watermark, OCR, convert to/from images, export to Markdown, and inspect PDF files from your terminal.

Built on pypdf and PyMuPDF, with a Typer interface.

Installation

pip install ultimate-pdf

Requires Python 3.10+.

The ocr command additionally needs the Tesseract engine:

brew install tesseract       # macOS
apt install tesseract-ocr    # Debian/Ubuntu

If OCR reports that tessdata cannot be found, set TESSDATA_PREFIX to your Tesseract data directory.

Usage

After installing, the ultimate-pdf command is available:

ultimate-pdf --help
ultimate-pdf version

Merge

Combine multiple PDFs into one:

ultimate-pdf merge a.pdf b.pdf c.pdf --output merged.pdf

Split

Split a PDF by page ranges, every N pages, or selected pages:

# One file per page range (writes into a directory)
ultimate-pdf split input.pdf --pages 1-3 --output out_dir/

# Every 2 pages into a separate file
ultimate-pdf split input.pdf --every 2 --output out_dir/

# Only selected pages
ultimate-pdf split input.pdf --select 1,3,5 --output out_dir/

Compress

Reduce file size:

ultimate-pdf compress input.pdf --output smaller.pdf
# Omit --output to write '<input>_compressed.pdf'

Rotate

Rotate pages by 90, 180, or 270 degrees:

ultimate-pdf rotate input.pdf --angle 90 --output rotated.pdf
# Rotate only specific pages
ultimate-pdf rotate input.pdf --angle 180 --pages 1,2 --output rotated.pdf

Encrypt / Decrypt

ultimate-pdf encrypt input.pdf --password secret --output locked.pdf
ultimate-pdf decrypt locked.pdf --password secret --output unlocked.pdf

Watermark

Stamp a text or image watermark (exactly one of --text / --image):

ultimate-pdf watermark input.pdf --text CONFIDENTIAL --opacity 0.15 --output wm.pdf
ultimate-pdf watermark input.pdf --image logo.png --pages 1,2 --output wm.pdf

PDF ↔ Image

# PDF pages to images (writes into '<input>_images/' by default)
ultimate-pdf pdf-to-image input.pdf --dpi 200 --format png

# Images into a single PDF (one image per page)
ultimate-pdf image-to-pdf a.png b.jpg --output out.pdf

OCR

Make a scanned PDF searchable, or extract recognized text (requires Tesseract):

ultimate-pdf ocr scan.pdf --output searchable.pdf          # searchable PDF
ultimate-pdf ocr scan.pdf --mode text --language eng       # prints text

Markdown

Export a PDF's text content to Markdown:

ultimate-pdf markdown input.pdf                 # writes '<input>.md'
ultimate-pdf markdown input.pdf --pages 1-3 -o out.md

Info

Show metadata and page count:

ultimate-pdf info input.pdf

License

MIT — see LICENSE.

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

ultimate_pdf-1.0.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

ultimate_pdf-1.0.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file ultimate_pdf-1.0.0.tar.gz.

File metadata

  • Download URL: ultimate_pdf-1.0.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ultimate_pdf-1.0.0.tar.gz
Algorithm Hash digest
SHA256 92057893c1b3f0f7f6565bedb3f8e20c8ae91e832e1ae2d9ce96a8670328b5c5
MD5 403b7e9112eae2b6c17ac37e2c82082c
BLAKE2b-256 2cfb852bc4ef354f00594d9a6fc9765507d950056b78fde586bcb7774ec24c73

See more details on using hashes here.

File details

Details for the file ultimate_pdf-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ultimate_pdf-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ultimate_pdf-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f31f7ba5573141a431187fbf04c91799291f3ef61c0d7c5fd346495a7c391986
MD5 2c971da498289bc542f1c78330d74d9e
BLAKE2b-256 846f473f5b02f0e50925c901410188751511985450d342a1855d009052fb3401

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