We help IT Professionals succeed at work.

PDF watermarking application

Alexandre Takacs
Alexandre Takacs used Ask the Experts™

I'm looking for a solution (if possible open source) that would allow me to batch process PDF files and apply an arbitrary sequential number on every fist page of every file in a folder.

I'm pretty sure there must be a decent solution around but all I have found are high end and extremely expensive software.

Any suggestion welcome.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Maybe this way:
* using Ghostscript (command line) http://www.ghostscript.com/ You can convert pdf to .jpg/gif
* maybe then You can watermark .jpg easier then .pdf
* at the end do pdf again for example by using http://sourceforge.net/projects/pdfcreator/

I know it is not a perfect way but maybe this would help.


Well it's an idea... but rather ugly ;)
If you  plan to install a shopping cart.
There is a module for Opencart

This module creates a unique header and footer watermark on PDFs that are downloaded from your OpenCart. This is great for ebook sellers who are looking for a way to discourage piracy of their products.

This mod has been tested on A4 sized PDFs and should work on US letter sizes.

The header consists of the customers name, email, and phone number. The footer is the date downloaded and a md5 hash of these values. You can modify these if you wish.


Nope this is a desktop use.

I want to add a numeric stamp on a batch of unrelated PDF files (regardless of their actual source and internal format). I understand it might be a little more involved than it might seem but I'm sure this is possible without shelling out 20k$
Have you tried jPdfTweak
It's opensource and powerful



Quite nice but doesn't do what I want (although I could use it's page numbering feature to get something approaching my requirement)
I have a solution I've been using for an internally developed application and I have been recently working on writing an article for EE on this exact topic.  I posted it today here (http://www.experts-exchange.com/Programming/Open_Source/A_7169-Using-open-source-tools-to-place-annotation-text-as-a-stamp-on-a-PDF-document.html)  Take a look and see if this helps solve your question.  Maciej_Modzelewski had a good suggestion of using GhostScript, but I agree with you that it is difficult to work with directly.  The other tools I mentioned in the article made it a piece of cake - ImageMagic and PDFTK.  And there are front-end tools to make working with ImageMagick even easier.  You'll see that on their site.

lenamtl, I haven't seen jPDFtweak before.  That was a good tip!

atak2983, I forgot to mention that my article only discusses applying a process to a single file.  However, the concept can be applied to a number of files using any number of scripting/programming languages.  What OS are you working with?  And what scripting/programming language would you like to use?  Just about anything can be used, including DOS batch files on modern Windows OS's with the advent of the SET command.


Interesting - thanks for your post.

I have not tested it -yet- but is this solution preserving the text layer of a muti-layer PDF (say a scan + OCR) ?

Yes, it preserves the text layer.  It's interesting you asked that because that article is one of a series of articles I am working on.  OCR is another aspect to the overall project that I'm working on.  But the answer to your question is yes, everything else in the PDF appears to be retained.  I haven't found anything that is lost.


Sounds good.

I will proceed with some tests and report in your thread in the programming section.
James MurrellProduct Specialist

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.