Hello all,
Using Acrobat 9 Pro, I have a bunch of converted PDF's in which I would like to perform a batch process, but I'm stumped. I can get pieces of the sequences but when I try to put them together it doesn't act like I would expect.
It goes something like this...
Command 1: Convert .docx to pdf (haven't got to this part yet)
Command 2: Detect and delete form fields from pdf's (this is what I have but doen't work):
for(var i = this.numFields - 1; i > -1; i--) {var fieldName = this.getNthFieldName(i); this.removeField(fieldName); }
Command 3: Add form fields at the bottom of the page, then in each field add a message and the date and time it was printed when it is printed:
for (var i = 0; i < this.numPages; i++)
{
var fd = this.addField("DocMessage", "text", i, [50,1,600,30]); fd.textSize=8; fd.textFont = "Arial"; fd.alignment = "center"; fd.fillColor = color.transparent; fd.textColor = color.black; fd.readonly = true; fd.print = true; fd.display = display.noView; } var strJS = 'var ofield = this.getField("DocMessage");';// Add Field to Document Script var strJS = 'var ofield = this.getField("DocMessage");'; strJS += 'var theDate = (new Date((new Date()).valueOf() + 1000 * 60 * 60 * 24 * 0));'; strJS += 'ofield.value = "This copy is an uncontrolled document and may not be reproduced without permission. Printed: ";'; strJS += 'ofield.value += " " + util.printd("mmm d, yyyy h:MM tt",theDate);'; this.addScript("AddMessage",strJS);
this.dirty = false; // prevent save prompt;
Command 4: Add electronic signature/certification (haven't got to this yet)
What am I doing wrong?
Any help would greatly be appreciated.
You haven't said what's wrong with #3.