Files
oam/knowledge base/ghostscript.md

1.5 KiB

Ghostscript

Table of contents

  1. TL;DR
  2. Reduce the size of PDF files
  3. Sources

TL;DR

# Install.
brew install ghostscript
sudo port install ghostscript

# Reduce the size of PDF files.
gs -dNOPAUSE -dQUIET -dBATCH \
  -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.4 \
  -sOutputFile=path/to/small/file.pdf \
  path/to/massive/file.pdf
gs \
  -o /path/to/resized.pdf \
  -sDEVICE=pdfwrite \
  -dPDFFitPage \
  -r300x300 \
  -g2550x3300 \
  /path/to/original.pdf

Reduce the size of PDF files

Execute the following:

gs -dNOPAUSE -dQUIET -dBATCH \
  -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.4 \
  -sOutputFile=path/to/small/file.pdf \
  path/to/massive/file.pdf

Use one of the following options for the value of -dPDFSETTINGS:

Value Description
/screen Screen-view-only quality, 72 dpi images
/ebook Low quality, 150 dpi images
/printer High quality, 300 dpi images
/prepress High quality, color preserving, 300 dpi images
/default Almost identical to /screen

Sources