Skip to main content
adamsski168
New Participant
January 23, 2018
Answered

Export fdf using a button javascript

  • January 23, 2018
  • 1 reply
  • 4985 views

Hi,

I have no javascripting knowledge, is it possible to add an export .fdf javascript to a button in a pdf form?

seems simple but i can't seem to find an example?

Thansk

Adamsski168

This topic has been closed for replies.
Correct answer Thom Parker

.You can use this script in a Button MouseUp Action:

this.exportAsFDF();

This displays a file Save As dialog for saving the FDF file. There is an input parameter for setting the file path. This won't work from a button script because specifying a path is a privileged operation. But it would work from an Acrobat DC Command. Look on the Actions panel. There is a feature for creating a new command. You can use this script with an input for saving the file to a specific name and location. Makes it a bit easier on the user, and make the functionality available to any open form.

1 reply

Inspiring
January 23, 2018

There are some built-in possibilities (e.g., doc.exportAsFDF), but they don't work with Reader. With Reader you can use JavaScript to build a string that's a complete FDF, but the user would have to somehow copy and paste it into a file.

adamsski168
New Participant
January 23, 2018

Hi George,

thanks for the response. I am using Acrobat Pro and creating my own forms. I just wanted to add an export data button for the users so we can start to build on the data entered.

Thansk

Adam

Inspiring
January 23, 2018

I may not have been clear, but the doc.exportAsFDF method will only work with Acrobat, so if any of the form users will be using Reader, then this approach won't work.