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

Need help with javascript to add a watermark via batch process

mhoffman
Registered: Aug 20 2010
Posts: 1

Hello, please forgive me if this has already been answered.

My problem:

I'm new to javascript and I need to add a watermark to the first page and every fifth page thereafter to a very large document 1000+ pages. (i.e, page 1, page 5, page 9, etc.). I'm trying to use the following code, but can't get the page variables correct. Can anyone offer advice? Thanks!

this.addWatermarkFromFile({

cDIPath: "myWatermark",

nStart: 0,

nEnd: 1000,

nHorizAlign: 0,

nVertAlign: 0,

nHorizValue: 0,

nVertValue: 0,

nRotation: 0

});

My Product Information:
Acrobat Pro 9.3.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "cDIPath" parameter must be the full Device Independant path and file name (with extension). Take a look at these two articles:

http://acrobatusers.com/tutorials/2006/create_use_layers
http://acrobatusers.com/tutorials/file-paths-acrobat-javascript

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script