Page 1 of 1

Variable watermark script

Posted: Tue Sep 30, 2014 10:33 am
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

Variable watermark script

Posted: Tue Sep 30, 2014 1:50 pm
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

});