This is a fairly old (2023/04) article I originally wrote on a now-decommissioned Wiki, not completely sure it’s up to date
PDFTk and its StampTk tool apparently do a pretty good job at generating watermarks and applying them to a PDF file. However only the former is shareware, StampTk being a paid addition.
Fortunately it’s relatively easy to generate a stamp on GIMP, then apply it to a document with PDFTk.
Stamp creation #
- Fire up GIMP, create a new image that’s about 400x200 pixels wide
- Add an alpha channel to your layer if it doesn’t have one already:
- Press your Suppr key to remove the background, and add a text box with whatever you want to overlay on your PDF file. Change the font size to make it fit in the canvas
- Rotate and center the text, then merge its layer with the transparent background by right-clicking it > Merge down
- Go to Filters > Map > Tile…
- Set the width to 826 and the height to 1169 (it’s likely possible to set it to a higher value as long as you keep this ratio)
- On the newly created picture, set the opacity to a reasonable number, such as 35 (so one can still see what’s going on behind the watermark)
- Export the image as PDF (NOTE: GIMP is currently bugged and has been for two years, export as PNG and use an online converter or imagemagick til it gets fixed)
Applying the stamp #
Run the following command:
pdftk "yourfile.pdf" multistamp watermark.pdf output "yourfile-wm.pdf" flatten
The flatten option prevents editing text fields afterwards, though I strongly recommend “printing” the PDF to merge the entire file into one layer, so the watermark isn’t easily scrapped off the doc.