Bad PDF-File-Compression with Default PDF-Print-Utilities

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
Wosh
Posts: 60
Joined: Mon 09 Jul 2007, 19:20
Location: Nuremberg Germany

Bad PDF-File-Compression with Default PDF-Print-Utilities

#1 Post by Wosh »

Printing in Puppy Linux is a mess!
As soon as I have more background information I will write a "Printing Howto".

But Windows-XP PDFCreator beaten by more than factor 3!

If I print an Abiword/Gnumeric file to one of the PDF-print utilities the generated PDF-file becomes 5 to 9 times bigger than the PDF-file generated with PDFCreator 0.9.3 in Windows-XP.

These utilities don't use CUPS-PDF!!!
Maybe someone can post me what they call and whether they are compiled to Abiword or are part of Gtk or whatever.


So if you want to get a real amazing compression for a PDF-file you have to choose:

"Generic Postscript" "Custom"

and then you must add the following line:

lpr -P CUPS-PDF

Test-Results
Example:
Abiword's test document /usr/share/examples/text/testdoc.doc: .............23552 Bytes

Puppy-Linux "Generic Postscript" Custom/lpr -P CUPS-PDF: testdoc.pdf 15974 Bytes
Windows-XP "PDF-Creator": ............................................................testdoc.pdf.....53851 Bytes
Puppy-Linux "Create a PDF document":.......................................testdoc.pdf 278002 Bytes
Puppy-Linux "Generic Postscript" File/Save As/PDF Files: ...testdoc.pdf 481361 Bytes

The last two PDF-sizes are not acceptable because they blow up the size of a tiny document like testdoc.doc up to 20 times.
Puppy-Linux CUPS and PDFCreator both depend on Ghostscript to create PDF-files so the CUPS-developers did a fairly good job..
I have not thrashed out all the CUPS-PDF printer options, so my result maybe still can be topped. After some more playing around I will report soon.
Last edited by Wosh on Sat 22 Dec 2007, 01:47, edited 4 times in total.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#2 Post by jcoder24 »

Did you print via "Generic Postscript" or "Create a PDF document"?

I created a sample abiword document in puppy (don't have access to windows) containing only text which was 6.4k in size. Printing via "Generic Postscript" gave a 7k pdf file. Printing via abiword's "Create a PDF document" generated a 118k pdf file.

The CUPS-PDF printer uses the defaults provided by the ghostscript driver. However, you can manipulate its options via the CUPS web interface by clicking the "Configure Printer" associated with CUPS-PDF printer.

User avatar
Wosh
Posts: 60
Joined: Mon 09 Jul 2007, 19:20
Location: Nuremberg Germany

Generic Postscript even worse

#3 Post by Wosh »

Hi jcoder24

I didn't know that it is possible to generate PDF-files via "Generic Postscript". So I have made the test with it too and the result is even worse. See the reedited topic. So how can I tune this output?

Thanks for your tip with the CUPS-PDF Printer Options. I will test to optimize the output size by varying them and post my results here.

If someone already has succeeded to decrease the PDF-file size please post your settings within this thread.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#4 Post by jcoder24 »

Can you create and attach a sample abiword file that produces the type of results you are seeing?

User avatar
Wosh
Posts: 60
Joined: Mon 09 Jul 2007, 19:20
Location: Nuremberg Germany

CUPS-PDF Printer Options only Decoration

#5 Post by Wosh »

Hi jcoder24

You already have /usr/share/examples/text/testdoc.doc. It is the test document of Abiword and good for PDF-conversion because it contains text and graphics.

I have played with the following options in CUPS-PDF:
PDF Colour Model:
PDF Settings:
PDF Colour Image Compression:
PDF Grey Image Compression:
PDF Monochrome Image Compression:
PDF Compatibility:
PDF Compress Pages:

But they only seem to be decoration the filesize of testdoc.pdf always becomes 278002 Bytes.
But as the PDF-file size generated by "Create a PDF document" is better than the size generated by "Generic Postscript" CUPS must call gs with different parameters. Can anybody tell me were the scripts for the gs-calls reside. I hadn't success searching them in /etc.

I have taken a look at the Ghostscript homepage, but all I have found is that Ghostscript is a book with seven seals. There are to many options for an unexperienced user. The most informative page is:

http://ghostscript.com/doc/8.54/Ps2pdf.htm

At least I have checked PDFCreator 0.9.3 a little bit more. It is based on GPL Ghostscript 8.54. It is Open Source and it's home page is:

http://www.pdfforge.org/

These guys seem to be cracks dealing with Ghostscript because they offer more compression options than CUPS-PDF and all files created by PDFCreator are at least 1/4 size of CUPS-PDF:

Image

They have an own forum over there. So maybe I will have to post my problem there, if I won't find a Ghostscript pro who is able to enable the same performance for the Linux user as they have in Windows (Grrr!).

In my naive hope that some Ghostscript guru can derive the parameters used I have attached testdoc.pdf created by PDFCreator.
Attachments
testdoc.pdf.zip
Zipped testdoc.pdf because pdf alone is not allowed. Why???
(49.96 KiB) Downloaded 239 times
Wosh

User avatar
Wosh
Posts: 60
Joined: Mon 09 Jul 2007, 19:20
Location: Nuremberg Germany

PDF-Compression Problem partially Solved

#6 Post by Wosh »

Hi all

I have managed to solve the biggest part of the PDF-compression problem (see revised topic).

But there are still some questions open:

1. Hi jcoder24:
I have seen that you have reworked the pdf-writer script. Is there a possibility to pass the PDF-filename within the Custom command line of Abiword Print (e.g.: lpr -P CUPS-PDF -o PCFileName=testdoc.pdf)?

2. The default PDF-print utilities perform to bad. Is it possible to improve them (e. g. use CUPS-PDF for them also or use the gs parameters of CUPS for them)? Maybe someone can inform me how these PDF-printers in Abiword/Gnumeric work.

User avatar
jcoder24
Posts: 604
Joined: Fri 06 May 2005, 12:33
Location: Barbados

#7 Post by jcoder24 »

Glad you got the pdf compression sorted out. I assumed that you had CUPS-PDF as default which you don't so it is useful for others to know about lpr -P CUPS-PDF. I'm not sure how possible your first request is but I'll look into it.

I plan to re-code some of the internals of cups-pdf and finish the options gui. Also planned is to back-port all of the changes over to pdfprinter-pdq so it may be a while in coming.

As for question two you may have to ask a question the respective forums.

Post Reply