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) --passwordfor 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
--passwordapplies 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) ora4(595×842 pt); defaultletter--binding:leftorright--pad:auto,yes, orno(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
--anglerequired (1–360; must be multiple of 90)--pagesdefault:all--passwordfor 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)
- Create a 4- or 8-page test PDF with page numbers visible.
- Run
vwpdfutils booklet doc.pdf doc_booklet.pdf. - Print duplex (flip on long edge), fold, and confirm page order reads 1…N.
Documentation
- spec.md — functional requirements
- plan.md — implementation plan
- tasks_checklist.md — implementation checklist
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27a3bd021bebaf50f093c1f8581311a426b45530f2cf790e4f2f538740f972f4
|
|
| MD5 |
8ea48e7c7ff4bca6f621766fe369c95a
|
|
| BLAKE2b-256 |
92f03c4cd58a312834242007a549899f7c87600d6bb85f2259d2ca3f4f865e40
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13fef69ff5fca30bf5ba2bc19b668a3894d94c4712bbf0461fdb91906dbac75a
|
|
| MD5 |
d27d7146a204cc3047614548964112a7
|
|
| BLAKE2b-256 |
24e4b57825ca7bf4a51668400ecc0d48b745c640bc144a7c95bb38827f6faf3f
|