Hi Guys
Being new to Acrobat, I trust you'll be patient.
I'm using Acrobat 9, have created various forms that contain many fields. I have enabled the "Extend features in Acrobat Reader" feature which allows our staff to fill in the fields and save the PDF locally with the data in it. ( A great feature!)
My problem is that frequently staff are required to email the PDF outside of the organisation and as such do not want it to be send in it's editable form.
I was wanting to add a button at the bottom of the form to "Save As" and remove " Extend features in Acrobat Reader" from the copy OR add a javascript to make all the fields read-only then "Save As? The original PDF still needs to be editable and staff need a simple solution.
The following code was suggsted by gkaiseril in this post:
http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=19117
But alas this does nothing when applied to the button, not a single field locks.
=======
var iFieldName; // for nth field name
var oFieldName; // object for iFieldName
// loop through fields or form
for(i = 0; i < this.NumFields; i++) {
iFieldName = this.getNthFieldName(i); // get i field name
oFieldName = this.getField(iFieldName); // object for i field name
oFieldName.readonly = false; // assume r/w
// process non-button fields only, buttons do not have a field value
if(ofieldName.type != "button") {
// test non-button field for a value
if(oFieldName.valueAsString != "") {
oFieldName.readonly = true; // has data so r/o
} // end if value not empty
} // end if non button type
} // end loop through fields
==========
Is this solution possible, am I barking up the wrong tree? Is there another solution.
Any assistance or suggestions VERY much appreciated, thank you in advance.
Boris
There was a coding error.
Another option would be flattening the form, but you then lose the form fields.
George Kaiser