Skip to content

Instantly share code, notes, and snippets.

@piersy
Created February 13, 2018 16:36
Show Gist options
  • Save piersy/6f8281071fefdc4090f63c901e3f4d77 to your computer and use it in GitHub Desktop.
Save piersy/6f8281071fefdc4090f63c901e3f4d77 to your computer and use it in GitHub Desktop.
Re-colors text of pdf files that contain no color information. In it's current configuration it will turn text from black to grey. (requires pdftk)
pdftk $1 output - uncompress | perl -p -e 's/BT$/BT\n0.3 0.3 0.3 rg/' | pdftk - output - compress > $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment