Skip to content

Instantly share code, notes, and snippets.

Forked from jduckles/
Last active January 2, 2021 16:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# Make a PDF look scanned.
# Extracted from and modified for smaller output files (compression lower density).
# Project requires ImageMagick and GhostScript. This will do the trick on Ubuntu:
# sudo apt-get install ghostscript
# sudo apt-get install imagemagick
# This should work on macOS with Homebrew:
# brew install ghostscript
# brew install imagemagick
# If you're getting a PDF security error see
convert -density 150 ${INPUT_FILE} -colorspace 'gray' +noise Gaussian -rotate 0.5 -depth 2 scanned_${INPUT_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment