Skip to main content
adamsski168
Participant
January 23, 2018
Answered

Export fdf using a button javascript

  • January 23, 2018
  • 1 reply
  • 5014 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
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

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
January 23, 2018

.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.

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