These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Button to "remove" Extend features in Acrobat Reader"

BorisBoris
Registered: May 19 2009
Posts: 4
Answered

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

My Product Information:
Acrobat Pro 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Somethings to consider, if your staff has the Standard version, saving the form can sometimes remobe the enabled rights.

There was a coding error.
var iFieldName; // for nth field namevar oFieldName; // object for iFieldNameconsole.println('number of fields: ' + this.numFields);// loop through fields or formfor(i = 0; i < this.numFields; i++) {console.println(i + ': ' + this.getNthFieldName(i));iFieldName = this.getNthFieldName(i); // get i field nameoFieldName = this.getField(iFieldName); // object for i field name// process non-button fields only, buttons do not have a field valueif(oFieldName.type != "button") {oFieldName.readonly = true; // has data so r/o} // end if non button type} // end loop through fields

Another option would be flattening the form, but you then lose the form fields.

George Kaiser

BorisBoris
Registered: May 19 2009
Posts: 4
gkaiseril

Cheers for the fix, this code works perfectly!! no messing around.

I have created 3 buttons in our forms to 1) Lock the fields, 2) Unlock the fields 3) "File save as" which hides all 3 buttons and Saves As!.

A simple solution to our problem and allows staff the required functionality with only having Adobe Reader installed (a viable solution for 300+ staff!)

For our needs this is a perfect solution!

Again many thanks for the prompt response. VERY appreciated

Boris