A pure-python CLI for PDF manipulation built on pypdf, fpdf2, and endesive.
pip install pdfly
# or with uv
uvx pdfly --help
| Command | Description |
|---|---|
| --------- | ------------- |
pdfly compress IN OUT | Lossless compression |
pdfly cat IN [PAGES]... -o OUT | Merge/split pages |
pdfly rm IN [PAGES]... -o OUT | Remove pages |
pdfly rotate -o OUT IN DEG [PGRGS] | Rotate pages |
pdfly sign IN --p12 CERT [-o OUT] | Sign PDF |
pdfly check-sign IN --pem CERT | Verify signature |
pdfly meta IN [-o FORMAT] | Show metadata |
pdfly pagemeta IN IDX [-o FORMAT] | Page details (0-based) |
pdfly extract-images IN | Extract images |
pdfly extract-text IN | Extract text |
pdfly extract-annotated-pages IN [-o OUT] | Extract annotated |
pdfly uncompress IN OUT | Decompress streams |
pdfly update-offsets IN [-o OUT] | Fix offsets |
pdfly 2-up IN OUT | 2-up layout |
pdfly booklet IN OUT [-b FILE] [-c FILE] | Booklet layout |
pdfly x2pdf [FILES]... -o OUT | Convert to PDF |
-o text # Default
-o json
-o yaml
See references/page-ranges.md for full syntax including negative indices and strides.
See references/sign.md for complete signing/verification workflow.
The -o/--output option is required and must come before positional arguments:
pdfly rotate -o output.pdf input.pdf 90 "1-3"
See references/rotate.md for full examples.
See references/cat.md for complex merge/split operations.
| Library | Purpose |
|---|---|
| --------- | --------- |
pypdf | PDF reading/writing, page manipulation |
fpdf2 | Creating PDFs from images/text |
endesive | PDF signing with PKCS12 |
pillow | Image processing |
cryptography | Cryptographic operations |
0 = Success1 = Error (file not found, invalid input, etc.)共 1 个版本