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

Conditional watermark

bren1519
Registered: Apr 28 2008
Posts: 27

Hi,

I've been asked to put a watermark on a form I designed but it needs to be conditional as there should be no watermark on the original printing of the form. My idea was to make it conditional on the date as they should be able to supply me with a static date that will be the first printing. I was able to come up with a javascript to create the watermark but am having trouble making it conditional. I am not trained in java but I can usually find the script by googling and modify it to suit my needs which is what I have done with the script below:

this.addWatermarkFromText({
cText: "Duplicate" ,
bOnTop: true,
bOnScreen: true,
nTextAlign: app.constants.align.left,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.center,
nHorizValue: 0,
nScale: 3,
nOpacity: 0.1,
nRotation: 45
});

Any help is very much appreciated!
Thx
Brenda

try67
Online
Expert
Registered: Oct 30 2008
Posts: 2399
It's not really clear what you're trying to achieve.
Do you want to first add the watermark and afterwards make it hidden or visible based on a certain condition?
Or do you want to run the code above based on the condition?

Basically, conditions in JavaScript are created with an if statement, like so:
if (condition) {// code to execute if condition is true} else {// code to execute if condition is not true}

If you want more specific help, you will need to explain your situation a bit better.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

bren1519
Registered: Apr 28 2008
Posts: 27
Ok....to clarify. When the form is originally printed (let's say on Sept 1/2010) we do not want a watermark on it. If we re-run the form on Oct 15/2010, we want the watermark to appear on the form stating it is a duplicate. So if I could say in my script.....

if current date > 2010-09-01, then run the script, otherwise do nothingHope that makes things a little clearer, but if not let me know of course. Thx for the help. Brenda

Note: I am supplying the fillable form to our I.S. dept who are attaching it to a program they have designed on the iSeries to pull the data and populate the form. They only want to store one version of the form if possible.