I'm trying to create a fillable form for users in my organization that use both Acrobat (9 & DC) and Reader (DC). The form is a template that is filled out by users in our organization and then needs to be locked for editing if it is ever distributed outside of the company.
I'm trying to set up a button that locks all the form fields AND disappears after it is clicked (so users outside our organization do not see it). I have the script for the locking finished/working, but I'm having trouble making the button disappear.
I've set up the following script on the click:
event.target.display = display.hidden;
This seems to make the button disappear for the users with Reader, but not with Acrobat.
I've also used:
this.getField("Button1").display = display.hidden;
and I have the same problem.
Any ideas on what I can do differently? I am not a heavy Java user, so I'm not well versed in this code...
That code should work all around. What behavior are you seeing with Acrobat? You know that even if the fields are locked and the button hidden that someone with Acrobat or any other editing tool can still unlock/unhide and edit the PDF.
Another option is to flatten the PDF. This removes the interactive part of the form fields, but leaves the image of the field behind. So now the form can't be edited. You could also apply security to the form with a certificate, so that it can't be easily edited.
Both these options, security and flattening can't be done from inside the PDF, or in Reader. They require a tool in Acrobat, security is of course built-in, but you could create your own custom tool for this.
You can download a free flattening tool here:
@Thom Parker: You indirectly solved my problem, thanks!
The behavior I was seeing in Acrobat was once the button was clicked, it was 'locking' the button and it became non-interactive.
Thanks again for the response!
Merge all of your code to a single command, so you could control in what
order it is executed. If you keep it separate there's no way to know for
sure what the order will be.
On 22 January 2018 at 22:03, Michael.Henderson <email@example.com>
@try67: Agreed. Merging is the best way to go. I had this code in one command, but the order of the code within the command seemed to make the difference here. Appreciate your input.
We'll I'm really happy I was able to help, even if it's indirect. I find that often, all I need is to talk to someone about an issue. They don't even have to answer, just talking makes you think about an issue differently, and then you see a different solution
Maybe it works in Reader because Reader can't flatten. Are you sure that it's really working in Reader?
@Thom Parker: Agreed. That's why I come to these forums from time to time when I get stuck.
Happy to help, but I sure would appreciate my answer marked as the correct one thanks