Skip to content

Instantly share code, notes, and snippets.

@fsalehpour
Last active June 13, 2022 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fsalehpour/d15018ee97e3069b94f91baea1fab07d to your computer and use it in GitHub Desktop.
Save fsalehpour/d15018ee97e3069b94f91baea1fab07d to your computer and use it in GitHub Desktop.
Tips to do things with ghostscripts
# Reduce the size of a PDF file
# https://askubuntu.com/a/256449/112818
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output_reduced.pdf input.pdf
# Convert a PDF to grayscale colour
# https://superuser.com/a/164857/989263
gs \
-sOutputFile=output_gray.pdf \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray \
-dProcessColorModel=/DeviceGray \
-dCompatibilityLevel=1.4 \
-dNOPAUSE \
-dBATCH \
input.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment