My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Add watermark/stamp to PDF with preview

Dominic's photo
Dominic
·Jul 25, 2016

Hi everyone.

I've built a web application in Laravel where the admin users are currently downloading a PDF file then manually adding 3 image files as a stamp/watermark using Adobe Acrobat's native features for adding watermarks, then re-uploading that PDF to the web application.

If at all possible, I would like to add this functionality to the web application. The functionality I'm looking for would allow the user to view the PDF in the webpage and decide where the stamp is placed using up/down, left/right buttons then once decided they could place the stamp in the desired location onto the PDF and add another if needed. The reason for the need to decide where the stamp is placed is because sometimes the stamp may not be visible if added to the same place each time due to content in the PDF obscuring the stamp.

So far I've looked at FDPF which I've used before to merge two PDF files together - I'm guessing this would help me achieve the watermark part, but how could I go about doing the preview part?

Any ideas or suggestions are welcome. I'm not restricted to PHP, any reasonable solution in PHP, JS or a script that could run in a Laravel application would be fine. I think I've seen something like this done before in .NET so I thought it should be possible to do using some other technologies.

A final thought is that if this isn't possible using PDFs, would it be possible if I switched to using image files as a base file where other image files are stamped onto?

Thanks for any suggestions or help!