Copy link to clipboard
Copied
Hello everyone, and thank you in advance to anyone who might be able to help.
I’ve created a complex interactive PDF form. Now I’d like to distribute it, but with protection in place to prevent users from accessing the structure of the form or copying the scripts.
I applied password protection to restrict editing, allowing users to fill out the form but not modify the pages. However, this causes a problem: script execution is blocked with a warning that the current permissions do not allow operations on templates.
In my form, various templates are used to generate pages, which are shown or hidden depending on user input. This functionality is blocked unless page modification is allowed — but if I enable that, the form’s structure and scripts become fully visible.
So, I tried a different approach: all templates are hidden, and I use spawn() to generate pages. But when I attempt to delete a page (instead of just hiding it), I still get a permissions error due to the protection settings.
Has anyone encountered a similar issue and found a workaround?
Thanks to everyone for your time and help!
Copy link to clipboard
Copied
The following settings do not allow viewing scripts or changing the document, but allow spawning templates and deleting the spawned pages:
Copy link to clipboard
Copied
Thanks for Your fast answer but unfortunately I applied that kind of protection and pages are created but page 0 (the only one that originally existed in file) can't be deleted. There are not error disclaimer but in console You can read:
RaiseError: Operazione non consentita.
Doc.deletePages:29:Field Genera Parcella:Mouse Up
===> Operazione non consentita.RaiseError: Operazione non consentita.
Doc.deletePages:29:Field Genera Parcella:Mouse Up
===> Operazione non consentita.
Copy link to clipboard
Copied
Let me clarify: it’s possible to delete one of the pages generated by the form, but there’s no way to delete the original existing page
Copy link to clipboard
Copied
Because the security policy prevents editing the file in other ways than specified. Also, that won't work at all if the file is used in Reader (even without the security policy). There you can only remove pages which were spawned from a Template.
Copy link to clipboard
Copied
Deleting a page that was not spawned from a template is changing the document, which the security settings prevent.