Specifying file name when saving FDF file.

Participant ,
Jun 06, 2020 Jun 06, 2020

Copy link to clipboard

Copied

I've found and tried some similar questions in this forum and they just don't work. I think it's because I don't understand correctly. When saving with FDF, I want to save with a file name that is a concatenation of some field names in the form and the save date and time. 

 

First, I tried writing the following code in a text field. The file name as expected is displayed.

 

var Pink = this.getField("PINK");
var Blue = this.getField("BLUE");
var FNAME = util.printd("yyyymmdd-HHMM-",new Date())+Pink.value+"-"+Blue.value+".fdf";
event.value = FNAME;

 

And then I created a button and created the following code. I deleted the last line above and added the following. Some are listed below, but all are actually just one line of code. I'm actually trying out more code. But those was all a failure. Because I want to let the user choose where to save the file, the save window must be opened.

 

this.exportAsFDF({cPath:cPath + FNAME});
this.exportAsFDF({cPath:FNAME});
this.exportAsFDF(cPath + FNAME);
this.exportAsFDF(FNAME);
this.exportAsFDF("FNAME");

 

 Actually I tried the following too.

 

this.exportAsFDF(util.printd("yyyymmdd-HHMM-",new Date())+Pink.value+"-"+Blue.value+".fdf")

 

Please tell me the correct description method. I haven't been able to find the right material for me.

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

77

Likes

translate

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
no replies

Have something to add?

Join the conversation