IMPORT FDF WITHOUTH SUCCESS
Good evening and good morning,
I'm having hard time trying to figure out a JS Code to import data from FDF files. Basically I have thousands of .fdf files saved in different Folders, this files have all the same name "TEST". My PDF Document has some textfields which I would like to populate accordingly to the value I write into a specific textfiled "NAME", the value will be always the name of one of the folders where a TEST.fdf is saved.
I put the following Code into the Javascript folder:
var importFDF = app.trustedFunction(function(doc, fdfPath) {
app.beginPriv();
var fdf = app.openFDF(fdfPath);
doc.importAnFDF(fdf);
fdf.close();
app.endPriv();
});
function importData() {
var Name = this.getField("NAME").value;
var fdfPath = "G:/_____/______/" + Name + "/TEST.fdf";
importFDF(this, fdfPath);
}
Then, I recalled the action through a button in my document: importData ( );
But the button just opens a random window, where I will have to go looking for my specific folder.
If I try to recall the action by importFDF(this, fdfPath); the Debugger says the fdfPath is not defined. Could anybody help me here? Also I'd like to ask, do you how to create the opposite action, so to extract values from the textfields in my Document ?
Thank you always in advance