Add watermark from JS that will change with user prompted info across multiple docs

New Here ,
Sep 20, 2017

Copy link to clipboard

Copied

Hello,

I am trying to add a script to prompt a user for 3 pieces of information.  This information will change for every user that wishes to open and print the document.  I also need to apply this to numerous (currently about 2,000) documents, and that number will increase as our engineers generate new blueprints.  I know 2,000 is a lot to process at once, but if I could batch this into groups of 100 or so that would still make things much easier than doing a single document at a time.  I am unable to download any third-party software to accomplish this so I am looking for a solution within Acrobat Pro XI.  I have created an action with the action wizard that uses document javascript, then saves the newly watermarked file to the local user computer.  I have tried performing this as a batch with multiple files, but I am require to re-enter the script with each document.

Is there a way to do this and apply it to multiple files only having to copy and past the script one time?  Below is a copy of the code that I have so far.  Any help is greatly appreciated.

function Watermark()

{

}

var dialogTitle = "Please Complete";

var string1 = "This PDF has been created for";

var defaultAnswer = "";

var string2 = app.response("Add Employee Name",

dialogTitle, defaultAnswer);

var string3 = app.response("Add JON",

dialogTitle, defaultAnswer);

var string4 = app.response("Add Work Order Number",

dialogTitle, defaultAnswer);

var string5 = "Valid for use ONLY on this work order.";

var defaultAnswer = "";

var cMyText = string1 +"\n"+ string2 +", JON "+ string3 +", Work Order "+ string4 +"\n"+ string5;

this.addWatermarkFromText({

     cText: cMyText,

     nHorizAlign:app.constants.align.left,

     nHorizValue: 650,

     nVertAlign: app.constants.align.bottom,

     nVertValue: 160,

     cFont: "Helvetica-Bold",

     nFontSize:22,

     aColor: ["RGB", 255, 0, 0],

     nRotation:0,

     nOpacity: 0.7,

     bOnTop:false,

});

TOPICS
Acrobat SDK and JavaScript, Windows

Views

247

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have something to add?

Join the conversation