Variable watermark script

Post Reply
verstraete
Newbie
Posts: 8
Joined: Thu Oct 03, 2013 2:01 pm

Variable watermark script

Post by verstraete »

Hello,

I'm trying to make a javascript that makes a variable watermark in acrobat depending on the filename.

The watermark is a second pdf file that is generated somewhere else, but looks like the filename of the pdf where the watermark has to come.



So filename is 276297-01_V01.1-R.pdf

Watermark filename is 276297-01_V01.1-Checklist.pdf



The filename is variable (current document) and so is the watermark filename.



Script as is now.



doc = app.activeDocs[0];



doc.addWatermarkFromFile({

cDIPath: "/Volumes/PPData/Switch_HF/Checklist_Output/Checklist/276297-01_V01.1-R-Checklist.PDF",

bOnTop: false,

bOnScreen: true,

bOnPrint: true,

nHorizAlign: app.constants.align.right,

nVertAlign: 0,

nHorizValue: 0,

nVertValue: 0,

nScale: 1,

bFixedPrint: false,

nRotation: 0,

nOpacity: 1

});



Thanks in advance

David
verstraete
Newbie
Posts: 8
Joined: Thu Oct 03, 2013 2:01 pm

Variable watermark script

Post by verstraete »

In meanwhile I solved the problem.



var doc = app.activeDocs[0];

var docName = app.activeDocs[0].info.Title;

var p = "/Volumes/PPData/Switch_HF/Checklist_Output/Checklist/" + docName + ".pdf";



doc.addWatermarkFromFile({

cDIPath: p,

bOnTop: false,

bOnScreen: true,

bOnPrint: true,

nHorizAlign: app.constants.align.right,

nVertAlign: 0,

nHorizValue: 0,

nVertValue: 0,

nScale: 1,

bFixedPrint: false,

nRotation: 0,

nOpacity: 1

});
Post Reply