Add Watermark to PDF’s of logged in user in WordPress upon upload to media library [closed]

Unless you embed the watermark in the PDF itself, people will be able to save or print without the watermark. Visitors savvy enough to know where their cache folder is can just grab the original PDF from there.

Adding a watermark to a PDF isn’t a WordPress-specific question, and will require some custom PHP coding on your part unless you want to try the WooCommerce add-on from the other answer, which would also require that you actually sell the PDF to each user.

There is an excellent library called FPDF which can read in your PDF file, then dynamically embed a watermark for each user – perhaps you’d want to add their IP address, in addition to their username and the date. I have used FPDF with a WordPress install where my client was selling online training, and FPDF was used to generate official certificates of completion once the client passed the exam. It included the date the exam was passed, along with their contact and license info. You would probably want to set up a Page Template and inside that template, call FPDF to open the source PDF (which you’d save outside of webroot, so only PHP can access it, not visitors) and embed the watermark, then output in an embed or object tag so they could also view it in the WP Page.