How to add color watermark with JavaScript in acrobat.

Asked By 10 points N/A Posted on -
qa-featured

Hi Experts,

I am trying to add color watermark with JavaScript in acrobat. Please teach me with a little description how can I automatically add a color watermark with JavaScript in acrobat.

Thanks

SHARE
Answered By 0 points N/A #198131

How to add color watermark with JavaScript in acrobat.

qa-featured

Watermark added to the PDF like you want it to be when you run the "addWatermarkFromFile()" code in the console window?

Once that works you are ready to create your trusted function. Add this code to a folder level JavaScript file
myWatermark = app.trustedFunction( function (oDoc)

{
app.beginPriv(); // Explicitly raise privilege

oDoc.addWatermarkFromFile({cDIPath: "C:/Users/Public/Desktop/HI-shortcuts/HIPS-stamp.pdf"});

app.endPriv();
}) ;

You'll find info on folder level scripts here:
https://acrobatusers.com/tutorials/folder_level_scripts

Next you'll need to call this function from the Keystroke script on the combobox.

if(this.willCommit)
myWatermark(this);

 

Regards

Rozack Susan

 

Related Questions