Skip to main content

CLI for common PDF operations (compress, concat, booklet, split, rotate, convert2pdf)

Project description

vwpdfutils

Command-line PDF utilities: compress, concat, booklet, split, rotate, and convert2pdf.

Installation

pip install .
# development
pip install -e ".[dev]"

Runtime dependency: pypdf[full] (includes PyCryptodome for encrypted PDFs and Pillow for images).

Global options

vwpdfutils [OPTIONS] COMMAND ...
Option Description
--version Print version and exit
-h, --help Show help
--pypdf-strict / --no-pypdf-strict Pass strict=True to pypdf readers (default: off, strict=False)
-v, --verbose Log steps to stderr

Commands

compress

Reduce PDF size toward a target percentage of the original file size (best-effort).

vwpdfutils compress report.pdf report_small.pdf
vwpdfutils compress report.pdf report_small.pdf --ratio 30
  • Default --ratio: 50 (target ~50% of original bytes)
  • --password for encrypted inputs

concat

Merge entire PDFs in CLI order (no per-file page ranges in v1).

vwpdfutils concat -o merged.pdf part1.pdf part2.pdf part3.pdf
  • --password applies to all encrypted inputs

booklet

Saddle-stitch 2-up imposition for duplex printing.

vwpdfutils booklet doc.pdf doc_booklet.pdf
vwpdfutils booklet doc.pdf doc_booklet.pdf --paper a4 --binding left
  • --paper: letter (612×792 pt) or a4 (595×842 pt); default letter
  • --binding: left or right
  • --pad: auto, yes, or no (pad to multiple of 4 pages)

split

Remove pages; output keeps remaining pages in order.

Page ranges are 1-based: 3, 2-5, 1,3,5-7, all, *.

vwpdfutils split input.pdf output.pdf --remove 1
vwpdfutils split input.pdf output.pdf --remove 2-4,10

--pages is an alias for --remove.

rotate

Rotate pages clockwise; v1 supports multiples of 90° only.

vwpdfutils rotate scan.pdf scan_fixed.pdf --angle 90 --pages 1
vwpdfutils rotate doc.pdf doc_rotated.pdf --angle 180 --pages all
  • --angle required (1–360; must be multiple of 90)
  • --pages default: all
  • --password for encrypted inputs

convert2pdf

One output page per input file, in order.

vwpdfutils convert2pdf -o album.pdf cover.png diagram.pdf notes.txt
  • PDF inputs: first page only
  • Images: PNG, JPEG, TIFF, BMP, GIF
  • Text: .txt (word-wrapped, one page)
  • Default page size: US Letter (612×792 pt)

Testing

pytest
pytest --cov=vwpdfutils --cov-report=term-missing

Limits (v1)

  • Practical guidance: ~500 pages, ~100 MB per file on typical desktops
  • No digital signatures, OCR, form filling, folder globbing, or GUI
  • Output overwrites existing files (verbose mode warns)

Booklet print check (manual)

  1. Create a 4- or 8-page test PDF with page numbers visible.
  2. Run vwpdfutils booklet doc.pdf doc_booklet.pdf.
  3. Print duplex (flip on long edge), fold, and confirm page order reads 1…N.

Documentation

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

vwpdfutils-1.0.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

vwpdfutils-1.0.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for vwpdfutils-1.0.0.tar.gz
Algorithm Hash digest
SHA256 27a3bd021bebaf50f093c1f8581311a426b45530f2cf790e4f2f538740f972f4
MD5 8ea48e7c7ff4bca6f621766fe369c95a
BLAKE2b-256 92f03c4cd58a312834242007a549899f7c87600d6bb85f2259d2ca3f4f865e40

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vwpdfutils-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13fef69ff5fca30bf5ba2bc19b668a3894d94c4712bbf0461fdb91906dbac75a
MD5 d27d7146a204cc3047614548964112a7
BLAKE2b-256 24e4b57825ca7bf4a51668400ecc0d48b745c640bc144a7c95bb38827f6faf3f

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