A pure-python CLI for PDF manipulation built on pypdf, fpdf2, and endesive.
bash
pip install pdfly
# or with uv
uvx pdfly --help
CommandDescriptionpdfly compress IN OUTLossless compressionpdfly cat IN [PAGES]... -o OUTMerge/split pagespdfly rm IN [PAGES]... -o OUTRemove pagespdfly rotate -o OUT IN DEG [PGRGS]Rotate pagespdfly sign IN --p12 CERT [-o OUT]Sign PDFpdfly check-sign IN --pem CERTVerify signaturepdfly meta IN [-o FORMAT]Show metadatapdfly pagemeta IN IDX [-o FORMAT]Page details (0-based)pdfly extract-images INExtract imagespdfly extract-text INExtract textpdfly extract-annotated-pages IN [-o OUT]Extract annotatedpdfly uncompress IN OUTDecompress streamspdfly update-offsets IN [-o OUT]Fix offsetspdfly 2-up IN OUT2-up layoutpdfly booklet IN OUT [-b FILE] [-c FILE]Booklet layoutpdfly x2pdf [FILES]... -o OUTConvert to PDF
bash
-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:
bash
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.
LibraryPurposepypdfPDF reading/writing, page manipulationfpdf2Creating PDFs from images/textendesivePDF signing with PKCS12pillowImage processingcryptographyCryptographic operations
0 = Success1 = Error (file not found, invalid input, etc.)