Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 833 Bytes

code-snippets.md

File metadata and controls

30 lines (18 loc) · 833 Bytes

Useful code snippets

These snippets of code are meant to be run on the command line, especially on a Linux-based machine. They will require extra packages to run.

Reduce size of a PDF

Using Ghostscrpt

Requires ghostscript package.

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default \
    -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages \
    -dCompressFonts=true -r150 -sOutputFile=output.pdf input.pdf

from AskUbuntu

Convert pdf to individual image files for each page

Requires poppler-utils.

pdftoppm -png input.pdf outputname

By default images will be at 150dpi resolution but can be altered.

from HowToGeek