These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Watermark or overlay at the time of Print

vkshor
Registered: Dec 17 2008
Posts: 2

I have thousands of SOP's that I would like to store on a file server and allow the end user access to the file. However I need a watermark to print on the document at the time of print with the date it was printed and something noting that this is only good for lets say 5 days from the date of print. I am unfamiliar with Javascript and I would assume it is something that needs a little coding to happen? I am currently using Adobe 8.0 Professional and most of the end users will have Adobe 8.0 Standard

My Product Information:
Acrobat Pro 8.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You will need to add to each PDF a 'Will Print' action to add the water mark using the 'addWaterMarkFromText()' method like:

this.addWatermarkFromText({
cText: "Document content expires 5 days from " + util.printd("mmm dd, yyyy", new Date()),
nTextAlign: app.constants.align.center,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.center,
nOpacity: 0.5
});

Now to add this to all your PDFs you can use the batch processing of the Professional version to add this script to each PDF using the 'setAction()' method.

var myWillPrint ='this.addWatermarkFromText({'
myWillPrint += 'cText: "Document content expires 5 days from " + util.printd("mmm dd, yyyy",'; myWillPrint += 'new Date()),';
myWillPrint += 'nTextAlign: app.constants.align.center,';
myWillPrint += 'nHorizAlign: app.constants.align.center,';
myWillPrint += 'nVertAlign: app.constants.align.center,';
myWillPrint += 'nOpacity: 0.5';
myWillPrint += '});'

this.setAction("WillPrint", myWillPrint);

George Kaiser

nabtesco
Registered: Feb 18 2009
Posts: 1
Hi i have the same problem as the person above. Here is what i have though.
this.addWatermarkFromText({
cText: "Document content expires 5 days from " + util.printd("mmm dd, yyyy", new Date()),
nTextAlign: app.constants.align.center,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.center,
nOpacity: 0.5
});
var myWillPrint ='this.addWatermarkFromText({'
myWillPrint += 'cText: "Document content expires 5 days from " + util.printd("mmm dd, yyyy",'; myWillPrint += 'new Date()),';
myWillPrint += 'nTextAlign: app.constants.align.center,';
myWillPrint += 'nHorizAlign: app.constants.align.center,';
myWillPrint += 'nVertAlign: app.constants.align.center,';
myWillPrint += 'nOpacity: 0.5';
myWillPrint += '});'

My Problem is. It will Create a Time stamp, than the next day when someone tries to Print this document it has Both the Day Befores Date, and the Next Days Date. Overlapping. Is there a Way to
Make this Javascript work like. When I Open The Document, it will create a Time stamp, and when i CLOSE it , it will delete the timestamp so that next day when someone tries to print it wont have Both Dates on there?
can anyone help me?