PDF forms with JS won't work directly on browsers
Copy link to clipboard
Copied
Hello friends!
A couple months ago I successfully made a set of 10 interactive PDF forms stuffed with Javascript. Basically I only show/hide layers depending on actions on the form (button click and check box state change). Simple.
OK, the case is that if you download the document to your computer and then open it with Reader everything will work perfectly. Now if instead you open it directly on the browser it will NOT work: the document will stuck with some of layers visible (that shouldn't be) and won't respond to anything.
I suspect that the browser is simply overriding any existing embedded code and just displaying the file as if it was a plain PDF document.
I would like to know if someone has experienced the same issue. In this case I would appreciate if someone could tell me that there is a work around or if I will have to explicitly tell to my users that they need to download the files in order to use them.
Thanks!
Copy link to clipboard
Copied
Yes, this is a known issue with many of the browsers' built-in PDF plugins. The solutions are to complain to the developers of these plugins and ask them to fix their software, and/or to instruct your users not to open the file inside the browser window but to download it and then use Adobe Reader (or Acrobat, if they have it) to open it.
Copy link to clipboard
Copied
Agree. I've created a PDF Form filling solution, which was amazing, using CAM::PDF, starting with that same form being submitted from a PDF (on most browsers), captured via PHP on a proxy, then using that proxy and Perl to fill in a replica of the form using CAM::PDF. Unfortunately, unless using Adobe Acrobat or Reader, one cannot read the data saved to the PDF form.
So, instead I created a dummy PDF template and used HTMLDoc to fill it in, making for a non-form PDF replica of the original PDF form used to submit the data.

