• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

800

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

Community Expert , 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

...

Votes

Translate

Translate
Community Expert ,
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.

Votes

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!

Votes

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
Community Expert ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

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

Votes

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
Community Expert ,
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

Votes

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!

Votes

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