Skip to main content
marketingn83032830
Participating Frequently
March 21, 2017
Answered

How to "lock" the form after filling it with the reader version?

  • March 21, 2017
  • 4 replies
  • 24992 views

I have been making some PDF for my clients for them to edit information and after that, they send it to third part but, of course, need to "lock" the PDF after using a reader version. Is it possible?

This topic has been closed for replies.
Correct answer try67

Can you explain to me how to do it with JS?


Sure. You can use this code:

for (var i=0; i<this.numFields; i++) {

    var f = this.getField(this.getNthFieldName(i));

    if (f==null) continue;

    f.readonly = true;

}

4 replies

JR Boulay
Community Expert
Community Expert
May 18, 2020

"Is it possible to reverse the read only after the scritp is run?"

Yes.

Replace this line:

f.readonly = true;

 

By:

f.readonly = false;

Acrobate du PDF, InDesigner et Photoshopographe
Participant
May 18, 2020

I know this is post is older yet it helped me do exactly what i needed at first.  Is it possible to reverse the read only after the scritp is run?  I've been unable to figure that out.

 

Legend
May 18, 2020

Run a similat script that sets readonly to false. Bear in mind there is no such thing as a form that can't be changed, if you are hoping for some kind of security.

Participant
September 17, 2018

Although this is marked as Not Answered, the instructions work like a charm!  Exactly what I needed.

Inspiring
March 21, 2017

You can make the fields read only using JavaScript.

With Digital Certificates you can not only lock field but also add special code to detect any changes since the signing of the form.

marketingn83032830
Participating Frequently
March 21, 2017

Can i use java script in adobe reader?

I made a form to send it to my client, after he fill it, he will send to the third part. What we would like is to lock the form only for the third part

try67
Community Expert
Community Expert
March 21, 2017

Depends on what commands you're using. You can set the fields as read-only in Reader using JS, yes.