Pdftk watermark removal
"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.
- Get the PDF with a watermark and copy it to the directory created e.g.
1cp watermark.pdf ~/temp/convert
- Move to the convert directory
- Uncompress the PDF
1pdftk watermark.pdf output uncompress.pdf uncompress
- 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
Open the new sanwatermark.pdf file with a PDF reader and confirm the watermark has been removed.
Finally compress the sanwatermark.pdf file
1pdftk sanwatermark.pdf output output.pdf compress
The file output.pdf is created without the watermark.