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

Export as FDF for selected pages of a PDF Form.

Explorer ,
Jan 29, 2023 Jan 29, 2023

Copy link to clipboard

Copied

Dear All

I would like find a way to export form data of selective pages in a PDF  as an FDF file. Currently, i can do it for all the pages of the PDF Form.

Even if it would be possible to exclude at least one (1) form field exporting it in FDF  that would also work for me.

 

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);

}
}
);

 

 

Script for Button in Acrobat form

 

function myDateString() {

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

}
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 ");

}

 

Any help?  Thanks very much. 

Views

531

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 2 Correct answers

Community Expert , Jan 30, 2023 Jan 30, 2023

oDoc.exportAsFDF({cPath: cPath + cFlName, aFields: [ "a", "b", "c"] })

 

Edited: it was missing a colon after aFields...

Votes

Translate

Translate
Community Expert , Jan 31, 2023 Jan 31, 2023

You need to pass the fields array as a parameter to the trusted function, just like you do with the doc object, file-name, etc.

Votes

Translate

Translate
Community Expert ,
Jan 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

 

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post if it helps you get responses.

 

<moved from using the community>

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 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

At the parameter aFields you can specify an array with field names to export.

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 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

Could you please give me sample code of how to pass the parameter?

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 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

oDoc.exportAsFDF({cPath: cPath + cFlName, aFields: [ "a", "b", "c"] })

 

Edited: it was missing a colon after aFields...

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 30, 2023 Jan 30, 2023

Copy link to clipboard

Copied

Sorry for my shortcomings. I have some confusion regarding the parameter to be passed in  oDoc.exportAsFDF(). The function used in Folder level & also document level (For Button)

 Folder Level

 

oDoc.exportAsFDF({cPath: cPath + cFlName, aFields: [ ]})
For Button
myExportFDF(this, directory, this.getField("Reg").value + myDateString() + ".fdf",[expected_Field1, expected_Field2, expected_Field3]);

 

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 31, 2023 Jan 31, 2023

Copy link to clipboard

Copied

LATEST

You need to pass the fields array as a parameter to the trusted function, just like you do with the doc object, file-name, 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