Skip to content

Instantly share code, notes, and snippets.

@FFY00
Created November 14, 2019 02:06
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 FFY00/44859162f9fcefa6cee7584730879ece to your computer and use it in GitHub Desktop.
Save FFY00/44859162f9fcefa6cee7584730879ece to your computer and use it in GitHub Desktop.
Remove watermark pdf
#!/bin/sh
pdftk $1 output fixed.pdf
pdftk fixed.pdf output uncompressed.pdf uncompress
sed -e 's|/Watermark||g' -e 's|<.*WatermarkSettings.*>||g' uncompressed.pdf > unwatermarked.pdf
pdftk unwatermarked.pdf output compressed.pdf compress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment