Pdftk watermark removal

Share on:

"PDFtk - The PDF Toolkit. PDFtk is a simple tool for doing everyday things with PDF documents. It comes in three flavors: PDFtk Free, PDFtk Pro, and our original command-line tool PDFtk Server."

In a prior blog post, the PDFTK utility was installed. Now use the utility to remove a watermark from a PDF.

  1. Get the PDF with a watermark and copy it to the directory created e.g.
1cp watermark.pdf ~/temp/convert
  1. Move to the convert directory
1cd ~/temp/convert
  1. Uncompress the PDF
1pdftk watermark.pdf output uncompress.pdf uncompress
  1. Use the SED utility to remove the watermark text e.g. replace WATERMARKTEXT with the text in your PDF. Ensure the text used is exactly that same as that identified in the PDF.
1sed -e "s/WATERMARKTEXT/ /" uncompress.pdf > sanwatermark.pdf
  1. Open the new sanwatermark.pdf file with a PDF reader and confirm the watermark has been removed.

  2. Finally compress the sanwatermark.pdf file

1pdftk sanwatermark.pdf output output.pdf compress

The file output.pdf is created without the watermark.