My company is creating a PDF survey (intended for other companies to complete) and we're trying to make the solution interactive (conditional checklists that become visible based on the status of other selections).

However, we're wary of doing anything that a surveyed company's IT department will flag while looking for possible malware. This would slow down the whole process.

So JavaScript is right out.

My question is, are the Actions that Adobe PDF includes for object properties also detected and treated as JavaScript?

I'm experimenting with simple visibility actions to create the effect we want, but don't want to make a big circle back into the same problem...

  • 2
    Maybe you are using the wrong tech for that. Have you tried Google Forms? – T. Sar May 25 '17 at 13:31
  • Are Actions in ADOBE PDF detected/treated as JavaScript? – Phillip Hamilton May 25 '17 at 13:59
  • 1
    Note that interactive PDFs and embedded forms don't work as expected in many PDF readers (not everyone has Adobe Acrobat installed). Consider testing at least the PDF readers built into browsers like Chrome or Edge. Even if the businesses receive your questionnaire, they may not be able to complete it. – amon May 25 '17 at 14:00
  • 1
    @PhillipHamilton You should first ask yourself if every company out there has the capability to use the actions on the PDFs. What would happen if you sent your action-enabled PDF to some business that don't use Adobe? Actions don't work correctly on Edge or Chrome. You should really consider a more global tech if you want to do a survery. – T. Sar May 25 '17 at 14:18
  • 1
    I've been writing JS for over 10 years. I have never run into a bigger !@#$show than Adobe PDFs and JavaScript. And yes, of course you have all the 3rd party supporters who are too smart to be bothered with supporting Adobe's half-hearted support of JS within their sandbox but even if it's just adobe products handling the PDFs, it's complete garbage. There are no standards. There is no backwards compatibility. AVOID. – Erik Reppen May 27 '17 at 2:34

Smart PDF forms are using Acrobat JavaScript, a specific flawor of JavaScript, suited to the use in PDF document, together with the PDF Object Model.

Acrobat JavaScript runs in a pretty well sealed sandbox, and has only a very limited number of accesses to the outside world, and all of them require an user action to be executed.

You might create a very simple form, using elementary Acrobat JavaScript, password-protect (owner password is sufficient) and/or Reader-enable it, and have it checked by the IT department.

I would bet, they would not notice much…

A potentially more important issue has been mentioned in the comments. Many (very many) PDF viewers are too dumb to deal with smart documents (meaning documents containing JavaScript). There are strategies to deal with that fact, by "charging" the document for a dumb viewer, and have JavaScript code executed when the document opens, which activates the "smart" personality of the document.


It is possible to create a PDF Form with actions that affect other fields on the form. For example, a checkbox could carry an action that will hide another field. This uses the Hide action and does not add any JavaScript to the PDF.

Note that this is not the same as a dynamically laid out form: the field will be invisible but the space it occupies on the page will remain. The only dynamic form layout method available in PDF is XFA, which is not widely supported.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.