Skip to content

Instantly share code, notes, and snippets.

@noscripter
Forked from vibegui/compress-pdf-with-gs.md
Created March 24, 2021 10:44
Show Gist options
  • Save noscripter/39e3480e918f5cffdb30eb3a221d4ae4 to your computer and use it in GitHub Desktop.
Save noscripter/39e3480e918f5cffdb30eb3a221d4ae4 to your computer and use it in GitHub Desktop.

Revisions

  1. @Gadr Gadr renamed this gist Aug 30, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @Gadr Gadr created this gist Aug 30, 2013.
    13 changes: 13 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

    ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

    Other options for PDFSETTINGS:

    - /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
    - /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
    - /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
    - /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
    - /default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.

    Source: http://ghostscript.com/doc/current/Ps2pdf.htm