Skip to content

Instantly share code, notes, and snippets.

@tienhv
Created March 14, 2016 15:51
Show Gist options
  • Select an option

  • Save tienhv/cd377e8de5a286e5de97 to your computer and use it in GitHub Desktop.

Select an option

Save tienhv/cd377e8de5a286e5de97 to your computer and use it in GitHub Desktop.
remove watermark / text from pdf
src:http://superuser.com/questions/448519/how-to-remove-watermark-from-pdf-using-pdftk
very simply task to perform:
use sed:
sed -e "s/watermarktextstring/ /g" <input.pdf >unwatermarked.pdf
but, after, be sure to repair resulting output pdf
pdftk unwatermarked.pdf output fixed.pdf && mv fixed.pdf unwatermarked.pdf
all into one command:
sed -e "s/watermarktextstring/ /g" <input.pdf >unwatermarked.pdf && pdftk unwatermarked.pdf output fixed.pdf && mv fixed.pdf unwatermarked.pdf
text watermarks are nothing else than a text between two tags inside the pdf compressed code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment