6

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.

8
  • IIRC you don't need to use the CUPS PDF printer. There should be a save to file option in the print dialog anyway.
    – muru
    Mar 8, 2016 at 12:53
  • @muru That depends on how the program handles the printing, I would not assume that. Mar 8, 2016 at 12:58
  • @muru Unfortunately, because this is a Java app, it uses a Java print dialog, which has no Save-To-File option. I am still stuck with printer-driver-cups-pdf ...
    – etsnyman
    Mar 8, 2016 at 12:58
  • Maybe you could try adjusting the CUPS PDF resolution via the CUPS web interface (https://localhost:631), or use Ghostscript or something to compress the PDF: askubuntu.com/q/113544/158442
    – muru
    Mar 8, 2016 at 13:02
  • 1
    @MeerLin can we just delete these off-topic comments?
    – muru
    Mar 8, 2016 at 13:18

2 Answers 2

3

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.

0

Maybe ghostscript can help you compress your PDFs, as it will reduce their size and also optimize them for viewing them on screen rather than on paper:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen \
-dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in.pdf

Alternatively maybe the answers to this question might be helpful.

6
  • Unfortunately, for reasons unknown to me, because these files contain only vectors, the new files that ghostscript creates are even larger. Sorry, but I did try that...
    – etsnyman
    Mar 8, 2016 at 13:04
  • @etsnyman Did you have a look on the link I provided? Mar 8, 2016 at 13:05
  • Yes, I have looked. Everything there seems to compress/optimize rasters, not vectors.
    – etsnyman
    Mar 8, 2016 at 13:07
  • @etsnyman mention what you have tried in the question, then.
    – muru
    Mar 8, 2016 at 13:15
  • @muru I did specifically mention that I cannot use image compression as it will not work. I didn't feel like listing the 5-6 different options I have tried.
    – etsnyman
    Mar 8, 2016 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .