1

I'm looking for a tool for macOS (Windows and Linux would also be nice) that will compress PDFs with a lossless or near-lossless methodology.

There is an interesting discussion for ImageOptim PDF compression that seems to be still hanging out in limbo.

It would be ideal if there were an application that would choose between PNG or JPEG2000 and re-encode the images as such based on the best savings + the least difference (a binary image differ).

2 Answers 2

0

If you open your file in Preview you will get several options. Select export from under the File menu and you can save the PDF file as jpeg, jpeg2000, png, tiff. You can also resave it as a PDF with an option to reduce size.

6
  • This is true, however when I've tried this in the past I never seemed to have real good success. It's been years since I've trusted or even tried Preview for this purpose, so perhaps I need to give it another shot to see how it goes...
    – ylluminate
    Oct 4, 2019 at 4:06
  • So I was under the impression that you were saying that you could re-save the PDF with JPEG2000 image compression for all images within the PDF while retaining OCR and all metadata, etc. Unfortunately I guess you were saying to save a PDF as JPEG2000 output and then reimport that and save as a PDF... Hrm.
    – ylluminate
    Oct 4, 2019 at 4:17
  • i was trying to answer your title question: I'm looking for a tool for macOS (Windows and Linux would also be nice) that will compress PDFs with a lossless or near-lossless methodology.
    – Natsfan
    Oct 4, 2019 at 4:39
  • i mentioned that you can resave a PDF as a new compressed PDF.
    – Natsfan
    Oct 4, 2019 at 4:40
  • Thanks for taking a stab, yes I understand. Unfortunately given this method, as I noted, you lose the text of the document and only retain images in an image only PDF from my test... By definition this is lossy in that it loses the textual data.
    – ylluminate
    Oct 4, 2019 at 16:02
0

Sounds to me like you want ghostscript.

Windows, Mac, And Linux. + free

https://www.ghostscript.com/blog/optimizing-pdfs.html

I have scripted it to sweep though file repos and lower storage space by hundreds of GB by just taking years of randomly encoded PDF files at various resolutions and shrinking them to normal viewing and printing sizes.

Marketing people have made 500Mb+ PDF files full of giant high res images, that I have shrank to 5-10Mb and put them side by side, challenging them to tell me which was thee and which I shrank.

Since you did mention JPEG2000, I do not think ghostscript supports that yet, have not used in a while so could be wrong. But you said ideal, not required.

2
  • Well, I might be willing to pursue your path, but do you have a simple incantation to perform this find-replace of the PDFs that might accomplish your proposal? It would also need to retain original date / timestamps metadata for each file as well... JPEG2000 would have been nice, but as long as the result is very-very near lossless, then this would be good.
    – ylluminate
    Oct 23, 2023 at 17:50
  • Not one per se, we did it though a collection of scripts, written in house using ghostscript, tesseract, and a bunch of powershell to handle the file times. We handled it by making a copy that was the compressed file in an identical file structure (essentially enumerating and swapping the drive letter from source to destination), sweeping back through the originals to get file attributes and setting them on the compressed clones, then copying them back en masse via robocoy over the originals. (Tesseract was for adding text search to files that did not have it at conversion) Oct 24, 2023 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.