Copy link to clipboard
Copied
Hi,
I am trying to write some code on the "exit" button of a survey that will close the form and export the data as a .csv file to a location on the user's computer of their choice. The data consists of simple radio button answers, some yes / no, and some multiple choice (four possible answers).
I've been messing around but haven't found a good solution..
Is this possible?
Thanks!
1 Correct answer
Acrobat JavaScript has lots of security issues, and so it is sandboxed and simply does not provide many features, such as saving non-PDF files to the user's file system, and even that is restricted. So there is no way to use JavaScript to export a CSV file out of Acrobat to file system.
Here's an article on Acrobat trust/security:
Trust and Privilege in Acrobat Scripts
There are ways around these issues, but they all pretty much require a trust mechanism such as the folder level script mentioned b
...Copy link to clipboard
Copied
Only if you can install a script on the local machine of each user.
Copy link to clipboard
Copied
Ok... is there a way I can at least get the document to save and close when the exit button is pushed?
Thanks!
Copy link to clipboard
Copied
Saving the file silently also requires installing a script on the local machine.
Copy link to clipboard
Copied
Acrobat JavaScript has lots of security issues, and so it is sandboxed and simply does not provide many features, such as saving non-PDF files to the user's file system, and even that is restricted. So there is no way to use JavaScript to export a CSV file out of Acrobat to file system.
Here's an article on Acrobat trust/security:
Trust and Privilege in Acrobat Scripts
There are ways around these issues, but they all pretty much require a trust mechanism such as the folder level script mentioned by Try67, or something other than JavaScript, like an Acrobat plug-in or an external (visual basic) application that uses the IAC (interapplication communication) API, or a server script, cause you can send a csv file to a server from Acrobat.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Great information! Thank you!

