This is an old revision of the document!
PDF Workflow
Burst PDF pages into individual files
This gives you the ability to work with each page on an individual basis. You can also see how large each page is by comparing file sizes. You can edit and compress each page efficiently prior to putting them together in a single pdf file.
- requires pdftk
- example:
pdftk input.pdf burst
Convert PDF to PS (PostScript)
- example:
pdf2ps input.pdf output.ps
Optimize individual PDF page
- burst a multi-page pdf file into single files
- options:
- convert the pdf file to ps, then use ps2pdf to write a new pdf file with image compression optimizations:
ps2pdf <options> input.ps output.pdf
- use GhostScript to convert and write a new pdf file with image compression optimizations (see section below)
Image Compression with Ghostscript
The ghostscript defaults -dAutoFilterColorImages=true and -dAutoFilterGrayImage=true cause ghostscript to automatically detect whether JPEG or Flate compression is most suitable for each image. JPEG is good for photo images. Flate is good for line drawings, cartoons and computer screen shots.
The compression can be forced to JPEG with
-dAutoFilterColorImages=false -dColorImageFilter=/DCTEncode
Other filters are /FlateEncode (zlib/gzip/pkzip) and /CCITTFaxEncode (ITU-T group 3 fax suitable for monochrome images).
To get smaller file sizes, enable image downsampling.
-dDownsampleColorImages=true -dColorImageDownsampleType=/Average -dColorImageDownsampleThreshold=1.5 -dColorImageResolution=72
This says that if the image resolution is greater than 72*1.5=108dpi, it should be resampled to 72dpi by averaging the pixels. There are similar settings for Gray and Mono images.
Using -dPDFSETTINGS=/screen will set color and gray image downsampling to 72dpi, -dPDFSETTINGS=/ebook will downsample to 150dpi, and -dPDFSETTINGS=/printer will downsample to 300dpi.