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

Saving FDF file giving Error

Explorer ,
Nov 13, 2022 Nov 13, 2022

Copy link to clipboard

Copied

Dear All,

I would like to save my acrobat form as FDF.

Through the code I found on this forum, I am getting error during saving the fdf file. Seeking your help about how to change the JavaScript code for this purpose?

 

Thanks in advance for your help.

 

Folder level javascript for Trusted Function

var myExportFDF = app.trustedFunction(

function(oDoc, cPath, cFlName) {

cPath = cPath.replace(/([^/])$/, "$1/");

try {

  app.beginPriv();
  

  oDoc.exportAsFDF({cPath: cPath + cFlName})
  
  
  app.endPriv();

     } catch (e) {

app.alert("Error During Save - " + e);

}
}
);

 Folder level javascript for Date

function myDateString() {

return util.printd("dd_mm_yy", new Date());

}

 

Script for Button in Acrobat form

var directory = "/Users/Me/Onedrive/Documents/FDF/"

if (typeof(myExportFDF) == "function") {

  myExportFDF(this, directory, this.getField("Reg").value + myDateString() + ".fdf");

} else {

  app.alert("Missing Save Function. Please contact forms administrator ");

}

 

When click the button it ends up with an error.

Error.jpg

 

I have tried my best to find out the  solution but failed. Now seeking for your kind help.

Thanks again!

 

Views

967

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 , Nov 16, 2022 Nov 16, 2022

Then you need to start debugging the code. For example, use a simpler file name, such as "1.fdf", instead of the one you currently use. If that works, the issue is probably with the value of the field, etc.

Votes

Translate

Translate
Community Expert ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

Are you able to do it manually, without the use of a script?

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 ,
Nov 15, 2022 Nov 15, 2022

Copy link to clipboard

Copied

Yes i can do it manually. Prepare form > More> Export Data>. It saves as fdf & opens correctly.

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 ,
Nov 16, 2022 Nov 16, 2022

Copy link to clipboard

Copied

LATEST

Then you need to start debugging the code. For example, use a simpler file name, such as "1.fdf", instead of the one you currently use. If that works, the issue is probably with the value of the field, etc.

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