Skip to main content
MRahnemun
Inspiring
May 1, 2020
Question

How to Hide JavaScript code in a form

  • May 1, 2020
  • 4 replies
  • 1198 views

Hello, 

 

I need to be able to hide my JavaScript in a Form, How can this be done?

 

Regards,

JP

This topic has been closed for replies.

4 replies

JR Boulay
Community Expert
Community Expert
May 1, 2020

"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 Photoshopographe
JR Boulay
Community Expert
Community Expert
May 1, 2020

"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 Photoshopographe
Bernd Alheit
Community Expert
Community Expert
May 1, 2020

You can obfuscate the code.

ls_rbls
Community Expert
Community Expert
May 1, 2020

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.