How to Hide JavaScript code in a form
Copy link to clipboard
Copied
Hello,
I need to be able to hide my JavaScript in a Form, How can this be done?
Regards,
JP
Copy link to clipboard
Copied
Hi,
I would say that there is a lot more involved in what you're asking.
Normally you just protect the document with password and apply editing and printing restrictions.
Protecting editing in such manner will prevent the users from accessing editing tools with Acrobat Pro DC for exapmle.
It will not prevent the document from having users save it to a postscript file format, printing to PDF, or flattening the protected file with web browsers or other types of PDF viewers.
If you're truly serious about PDF security, see below for more extensive about security:
https://www.pdfscripting.com/public/Trust-and-Privilege-in-Acrobat-Scripts.cfm
That link above will open your eyes more to what you will be dealing with and give you an insight o how to tighten up your PDFs.
Copy link to clipboard
Copied
You can obfuscate the code.
Copy link to clipboard
Copied
"Protecting editing in such manner will prevent the users from accessing editing tools with Acrobat Pro DC for exapmle."
lol
You are not serious, or you give bad advice 😉
Acrobate du PDF, InDesigner et Photoshoptographe
Copy link to clipboard
Copied
"You can obfuscate the code."
This is the best way for the PDF form to be rejected by all antivirus and anti malware, as well as by Gmail and most email servers.
I recommend instead to minify the JavaScript, it is not a real protection but it goes everywhere.
To "protect" my minified scripts I drown them in the mass, by adding dozens of unnecessary lines of code.
Acrobate du PDF, InDesigner et Photoshoptographe

