You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Ghostscript-based PDF compressor and update docs (fixes#129)
- Add pdf_compressor_ghostscript.py using open-source Ghostscript - Update README.md with both legacy and recommended methods - Update requirements.txt to note system dependencies - Fixes issue #129: PDFTron/PDFNet is now commercial and requires license - Provides free alternative with same functionality and API
This will spawn a new compressed PDF file under the name `bert-paper-min.pdf`.
2
+
3
+
This directory contains two approaches:
4
+
5
+
- Legacy (commercial): `pdf_compressor.py` uses PDFTron/PDFNet. PDFNet now requires a license key and the old pip package is not freely available, so this may not work without a license.
6
+
- Recommended (open source): `pdf_compressor_ghostscript.py` uses Ghostscript to compress PDFs.
In testing, `bert-paper.pdf` (~757 KB) compressed to ~407 KB with `power=1`.
45
+
46
+
## Legacy PDFNet method (requires license)
47
+
48
+
If you have a valid license and the PDFNet SDK installed, you can use the original `pdf_compressor.py` script. Note that the previously referenced `PDFNetPython3` pip package is not freely available and may not install via pip. Refer to the vendor's documentation for installation and licensing.
0 commit comments