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.
oDoc.exportAsFDF({cPath: cPath + cFlName, aFields: [ "a", "b", "c"] })
Edited: it was missing a colon after aFields...
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.
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>
Copy link to clipboard
Copied
At the parameter aFields you can specify an array with field names to export.
Copy link to clipboard
Copied
Could you please give me sample code of how to pass the parameter?
Copy link to clipboard
Copied
oDoc.exportAsFDF({cPath: cPath + cFlName, aFields: [ "a", "b", "c"] })
Edited: it was missing a colon after aFields...
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)
oDoc.exportAsFDF({cPath: cPath + cFlName, aFields: [ ]})
For Button
myExportFDF(this, directory, this.getField("Reg").value + myDateString() + ".fdf",[expected_Field1, expected_Field2, expected_Field3]);
Copy link to clipboard
Copied
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.