keotl / invert-pdf

A free online PDF colour inverter. (for printing dark PDFs.)
MIT License
97 stars 50 forks source link

PDF file compression #13

Open brandonnly opened 3 years ago

brandonnly commented 3 years ago

After conversion, there seems to be a lot of garbage in the pdf file. 200kb files bloating up over 10 times the size.

Could use something like pylovepdf to compress files before returning them. Found that it compressed it back to a few hundred KB on the lowest compression settings without any noticeable reduction in quality.

keotl commented 3 years ago

Hi, thanks for the idea. Image compression would likely be possible, but I would offer it only as an option instead of being enabled by default. (Unless the compression is completely lossless, I can see that even the slightest artifacting could be an issue for some users when high accuracy is a requirement.)

Sadly, ilovepdf is not free/open source software, so I don't really want to use it directly in this project. A similar result should be achievable using image magick directly.