Skip to content

Instantly share code, notes, and snippets.

@cereal-s

cereal-s/command.md

Last active Nov 28, 2019
Embed
What would you like to do?
Add contrast to pale PDF document with ImageMagick and pdfimages

COMMANDS

  pdfimages -j -p file.pdf ./images/prefix
  cd images
  mogrify -level 80%,85% -sharpen 0x1 prefix*.jpg
  convert -background white -page a4 prefix*.jpg new.pdf

NOTES

If ImageMagick returns a not autorized error go to /etc/ImageMagick-VERSION/policy.xml and change the line:

  <policy domain="coder" rights="none" pattern="PDF" />

To:

  <policy domain="coder" rights="read|write" pattern="PDF" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment