Skip to content

Instantly share code, notes, and snippets.

@andersy005
Last active May 27, 2020 01:02
Show Gist options
  • Save andersy005/d8c75a877e3a2814a4daa8d1e82edd3e to your computer and use it in GitHub Desktop.
Save andersy005/d8c75a877e3a2814a4daa8d1e82edd3e to your computer and use it in GitHub Desktop.
Working with PDFs

Merge / convert multiple PDF files into one PDF

Ref: https://stackoverflow.com/questions/2507766/merge-convert-multiple-pdf-files-into-one-pdf

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=merged.pdf mine1.pdf mine2.pdf
pdfmerge() { gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=$@ ; }

Reduce Size of PDF

Ref: https://askubuntu.com/a/256449

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment