Ubuntu – Reduce size of printed-to-PDF files

pdf

I have a niche Java app that I use extensively (since it's Java and thus basically cross-platform, and since it can cater to my needs), and its job is to produce a printed page with text on it.

However, I need to distribute those printed pages electronically, and thus I installed the printer-driver-cups-pdf package, which gives me a PDF printer, and thus I can distribute PDF's to my team members.

However, these "printed" PDF's are enormous. A 2-page PDF is easily 800kb, and three pages are well over 1MB. This is a problem, since I cannot easily e-mail 10 of these documents to someone quickly.

Exporting a page with around the same amount of text within LibreOffice results in PDF files at least 10 times smaller.

Does anyone have any suggestions?

I cannot use image compression, since these pages contain only vectors.

Incidentally, I am using Ubuntu 15.10.

Thanks in advance!

EDIT: I have already tried Ghostscript with various -dPDFSETTINGS=/ settings. That, however, does not work, since it only applies to raster images. I have also tried converting to/from SVG, PS and EPS. I am still stuck with preposterously huge vector PDF files.

Best Answer

cups-pdf has been broken for a long time. It produces very large PDF files that encapsulate images and do not support text selection (for copy-paste).

A decent alternative is the Tea4CUPS virtual printer.

It works well most of the time for me, but sometimes printing with Tea4CUPS will abort -- in those cases, I resort to the Ubuntu built-in Print to File option.