A simple CLI for selecting, organizing, and preparing PDFs for printing.
./install.shThe installer creates an isolated environment in ~/.local/share/epdf and
places the command at ~/.local/bin/epdf. When necessary, it adds that
directory to PATH automatically. Open a new terminal after installation.
epdf extract book.pdf 1-10,15,r3-r1 -o excerpt.pdf
epdf extract book.pdf 1- --exclude 4,8-10 --odd -o odd-pages.pdfThe syntax accepts individual pages (7), ranges (2-8), descending ranges
(8-2), pages counted from the end (r1, r2), open ranges (5-, ..8),
and exclusions (!4, --exclude 8-10). --odd and --even filter by the
original page number.
epdf nup book.pdf 4Supported values are 2, 3, 4, 6, 8, and 10. Output uses A4 with
automatic grid and orientation. Without -o, the example creates
book-4up.pdf.
Select pages and optionally add spacing or borders:
epdf nup book.pdf 4 --pages 5-r2 --gap 3 --borderepdf info book.pdfShows file size, page count, encryption, page dimensions, and orientations.
epdf merge cover.pdf book.pdf appendix.pdf -o complete.pdfWithout -o, this creates cover-merged.pdf.
epdf split book.pdf 20Creates files such as book-001-020.pdf, book-021-040.pdf, and so on.
Use --output-dir DIRECTORY to choose another directory.
epdf parity book.pdfCreates book-odd.pdf and book-even.pdf. Use --output-dir DIRECTORY to
choose another directory.
epdf rotate scan.pdf 90 --pages 2,4,6Without --pages, all pages are rotated. The automatic output name is
scan-rotated.pdf.
epdf normalize scan.pdfEach page is scaled proportionally onto an A4 sheet while preserving portrait
or landscape orientation. This creates scan-a4.pdf.
epdf mirror scan.pdf horizontal
epdf mirror scan.pdf vertical --pages 2,4-6
epdf mirror scan.pdf bothWithout --pages, every page is mirrored. The automatic output name is
scan-mirrored.pdf.
epdf number book.pdf
epdf number book.pdf --start 10 --topNumbering starts at 1 and appears in the footer by default. This creates
book-numbered.pdf.
epdf watermark book.pdf watermark.pdfUses the first page of watermark.pdf as the background of every page and
creates book-watermarked.pdf.
Use -o OUTPUT.pdf when a command supports an explicit output name, and
--force to overwrite existing files.
epdf --help
epdf COMMAND --helpRun the test suite from a source checkout:
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=src python3 -m unittest discover -s tests -vRun the CLI without installing it:
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=src python3 -m epdf.cli --helpSee AGENTS.md for architecture, invariants, and the handoff guide for future maintainers and coding agents.