0

For printing scanned graphics to PDF, I currently use CutePDF Writer. According to pdfimages, in the generated PDFs it embeds:

  • Black and white images (1 bit) as: losslessly compressed

  • Grayscale images (8 bit) as: losslessly compressed

  • True color images (24 bit) as: JPEG

The result is that grayscale documents are often larger than their color counterparts.

Is it possible to make CutePDF embed grayscale images as JPEG images?

Ideally, there also is an option to configure compression ratio.

Update

Following the suggestion by @Rik, I edited %programfiles%\Acro Software\CutePDF Writer\PDFWrite.rsp. My settings:

-sDEVICE=pdfwrite
-q
-dAutoRotatePages=/All
-dCompatibilityLevel=1.4
-dNOPAUSE
-dBATCH
-dMonoImageFilter=/FlateEncode
-dEncodeMonoImages=true
-dGrayImageFilter=/DCTEncode
-dEncodeGrayImages=true
-dColorImageFilter=/DCTEncode
-dEncodeColorImages=true

File size of my test PDF is now about half compared to before, and according to Xara Xtreme 5.1, the images are now embedded a JPEG (DCTEncode), while before they were embedded with lossless compression (FlateEncode). Strangely, pdfimages still extracts them as ppm despite the -j switch.

I also upgraded to the latest CutePDF Writer, and to Ghostscript 9.10.

And, very important, when printing, I have to select: print as PDF Otherwise, I would again get the lossless encoding (I don't understand why).

feklee
  • 1,744

1 Answers1

1

According to the help of CutePDF you can set the options in the following file:
%Program Files%\Acro Software\CutePDF Writer\PDFWrite.rsp


This is for adjusting the overall print-quality:

How to reduce the size of output PDF file?
You can alter the parameters used in a text file %Program Files%\Acro Software\CutePDF Writer\PDFWrite.rsp. The key parameters are in the line:

-dPDFSETTINGS=configuration

where configuration can be /screen, /printer, /prepress, /default. Using /Printer can cut size by half. You may get more info at here.


The problem with CutePdf is that you can't set these options for compression etc in a GUI. (e.g. with PDFCreator you can do this) You need to set it in PDFWrite.rsp.

In the PDFWrite.rsp you can set all the options you would for Ghostscript (which CutePDF uses for creation of the PDF). There are a lot of options for compression and downscaling etc. You can find the options here.

For example:

-dGrayImageDownsampleType=/Average 
-dGrayImageResolution=72
-dEncodeGrayImages=true
-dAutoFilterGrayImages=true

You need to find out what the best settings for your documents are.

Just for your reference: PDFCreator uses the following standard options. Maybe some of these options are a better fit then what CutePDF gives you (you need to try which ones): (Or you could try PDFCreator for yourself if it does a better job). PS. Always make sure to deselect any third-party software during install of free software (if you don't want them).

-q
-dNOPAUSE
-dBATCH
-sFONTPATH=C:\Windows\Fonts
-sDEVICE=pdfwrite
-dPDFSETTINGS=/default
-dCompatibilityLevel=1.3
-dProcessColorModel=/DeviceCMYK
-dAutoRotatePages=/PageByPage
-dCompressPages=true
-dEmbedAllFonts=true
-dSubsetFonts=true
-dMaxSubsetPct=100
-dConvertCMYKImagesToRGB=false
-dEncodeColorImages=true
-dAutoFilterColorImages=true
-dEncodeGrayImages=true
-dAutoFilterGrayImages=true
-dEncodeMonoImages=true
-dMonoImageFilter=/CCITTFaxEncode
-dDownsampleMonoImages=false
-dPreserveOverprintSettings=true
-dUCRandBGInfo=/Preserve
-dUseFlateCompression=true
-dParseDSCCommentsForDocInfo=true
-dParseDSCComments=true
-dOPM=0
-dOffOptimizations=0
-dLockDistillerParams=false
-dGrayImageDepth=-1
-dASCII85EncodePages=false
-dDefaultRenderingIntent=/Default
-dTransferFunctionInfo=/Preserve
-dPreserveHalftoneInfo=false
-dDetectBlends=true

Edit:

Shouldn't you also use -dAutoFilterGrayImages=false ??

With -dAutoFilterGrayImages=true (default) it will revert back to what it finds best.

I found this note somewhere:

(note 1) Currently, AutoFilterxxxImages doesn't examine the image to decide between JPEG and LZW or Flate compression: it always uses Flate compression. If you want to force JPEG compression, use -dAutoFilterxxxImages=false.

Rik
  • 13,565