This message is related to the one posted today.
I'm attaching the script again at the end, altough i've already found the line where acrobat reader fails:
this.removeField(fieldName);
So, now i'm wonder how to solve this method call.
Thanks Thom, i could find the exact line by doing some debugging!!.
/* In the following script i've changed the less than symbol for < literal in order to have it well displayed */
var feimp=new Date();
var lorva='VALIDO POR EL DIA DE '+util.printd("dd/mmm/yyyy HH:MM:ss",feimp)+'.';
for(var pag=0;pag < this.numPages;pag++){
var fieldName='txtBtm'+pag;
var mife=this.getField(fieldName);
if(mife!=null) this.removeField(fieldName);
var aRect = this.getPageBox( {nPage: pag} );
var bRect=Array(0,aRect[1],60,0);
mife=this.addField(fieldName,'text',pag,bRect);
mife.display=display.noView;
mife.alignment='center';
mife.textFont=font.TimesB;
mife.textSize=18;
mife.rotation=90+this.getPageRotation(pag);
mife.value=lorva;
}
this.dirty=false;
The above script can be used as an automation script for setting up your PDFs in Acrobat Pro. Place it in a Folder Level Script and use a toolbar button or menu item to run the code.
However, you have way too much code here anyway. You should not be doing field creation on a working form. The fields should already exist on the doc that distributed to users. All you need to do is fill in the date value. There is also no need to put different fields on each page. Name all the field same and you only have to fill it in once.
Put this one line of code in your "WillPrint" event
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script