Hello,
I create this function for clean a watermark, but when I print my document this watermark it's present
function clean()
{
var ocgArray = this.getOCGs(this.pageNum);
for (var i=0; i < ocgArray.length; i++)
{
if (ocgArray[i].name == "Watermark")
{
ocgArray[i].state = false;
}
}
}
I created my watermark with "addWatermarkFromText" when I was opening my pdf
function init()
{
if(bOpened == "true")
{
// document already been opened
}
else
{
this.addWatermarkFromText({
cText: "C O P Y",
nFontSize: 70,
nRotation: 45,
bOnScreen: true,
nOpacity: .5 });
bOpened = "true";
}
}
// call init
init();
thanks
ayim
To see the names of the layers in your PDF, run the following script from your JavaScript debugger console:
console.show();
console.clear();
console.println("OCG Layer names:");
var ocgArray = this.getOCGs();
for (var i=0; i < ocgArray.length; i++)
console.println("Layer " + i + " is named: " + ocgArray[i].name);
George Kaiser