Close form and export data as csv with button

Explorer ,
Jan 08, 2019 Jan 08, 2019

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!

TOPICS
Acrobat SDK and JavaScript, Windows

Views

257

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jan 08, 2019 Jan 08, 2019
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...

Likes

Translate

Translate
Adobe Community Professional ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

Only if you can install a script on the local machine of each user.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 08, 2019 Jan 08, 2019

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!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

Saving the file silently also requires installing a script on the local machine.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jan 08, 2019 Jan 08, 2019

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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 09, 2019 Jan 09, 2019

Copy link to clipboard

Copied

LATEST

Great information! Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines