A simple utility that takes a directory of PDFs containing images and a directory of PDFs containing text and makes a multi-page low-res PDF with images and text combined.
python3 squashPDFs.py ~/Documents/image_pdfs ~/Documents/text_pdfs ~/Documents/output.pdf
- Ghostscript to compress the PDFs
- pyPDF2 for merging image and text PDFs
If you use the Nix package manager then in the terminal, just enter:
nix-shell
Otherwise ensure you have Python3.8
, pyPDF2
and Ghostscript
installed.
Instructions for Linux and pre macOS Catalina
For macOS Catalina users the recommended method is here