• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

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?

TOPICS
PDF forms

Views

20.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 21, 2017 Mar 21, 2017

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;

}

Votes

Translate

Translate
LEGEND ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

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;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

I will sound like a stupid, but i dont really know where to put this code in adobe reader

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

This code will work in Reader, but to apply it to your file you must have Acrobat.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

I have acrobat. But my client and the third part dont have it, only the reader.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

That's fine. You can create a "Lock Form" button and attach this code as it's MouseUp action.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

Where is teh option of create a button?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2017 Mar 21, 2017

Copy link to clipboard

Copied

What version of Acrobat do you use?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

My version is acrobat pro DC, and my client's version is only reader.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

Go to Tools - Prepare Form, and then use the Button tool to draw your field.

Right-click it and select Properties. Go to the Actions tab. Add new MouseUp triggered event and add an "Execute JavaScript" command, and then paste this code into the window that opens.

Set the rest of the button's appearance properties and you're done!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

Is it possible doing it with reader version?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

No! I answered this question multiple times already... You have to set it up in Acrobat and then the code will work in Reader.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

I dont need to "lock" the form in acrobat, I need to lock it in reader. I create the form, send it to my client and he will fill it and after that he will need to lock the form and send to the third part. So, my client doesnt have acrobat version.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

When you create the form with Adobe Acrobat you can also add the code.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2017 Mar 22, 2017

Copy link to clipboard

Copied

I don't know how to explain it differently... If you follow my instructions it will work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 12, 2022 Nov 12, 2022

Copy link to clipboard

Copied

I know this is from 2017.  I do this with Acrobat Pro but there is no "Execute JavaScript" command in the list when I go tthe actions tab for the button.  If not, how can I add the command?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 12, 2022 Nov 12, 2022

Copy link to clipboard

Copied

LATEST

What does you see at the action list?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 03, 2021 Mar 03, 2021

Copy link to clipboard

Copied

This does work well with a button however, lets say I wanted this code to execute upon being saved in Reader; how would one do that? I tried applying this and similar variations of code under Document Actions "Document Will Save" and it technically works...however I can't even save the form to distribute because it makes everything read only when I save it haha. Any help with this conundrum would be greatly appreciated. Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 03, 2021 Mar 03, 2021

Copy link to clipboard

Copied

Well, it's working as advertised... What you can do is disable JS before saving the file, via Edit - Preferences - JavaScript.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

@try67 This was brilliant! (Once I figured out how to fix the settings after accidentally clicking the yellow Javascript warning and telling it to "Always trust Javascript" for this particular document. Thank you so much for the simple yet brilliant advice!

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

@try67 

Hello, I have a question:

Is it possible to add in your code some kind of exception? I want to lock most of the document except a few form fields: e.g. I created a button that will lock all the form fields fiiled in by the applicant, but will leave unlocked some form fields for the administration. Is that possible? I'm not a developer, so I can't code...

I wonder if you would add in the code somewhere, a command in the lines of "lock all form fields readonly= true, but leave "FieldNameXYZ"=false.?

Is this possible?

Thanks in advance and kindest regards,

Nuno

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines