Skip to main content
Participant
July 7, 2020
Question

exportAsFDF not trusted

  • July 7, 2020
  • 1 reply
  • 650 views

I have made a Pdf-document with a form.

I want to export as FDF - on Acrobat READER.

 

So I created a .js file, and placed in javascript folder on the computer running the reader.

File -->

var Trusted_handleIndexNo = app.trustedFunction(handleIndexNo);

function handleIndexNo()
{
app.beginPriv();
if (this.getField("indexno").value == "") {
this.importAnFDF("/c/FDFdata/noSerie/indexno_data.fdf");

var v = +this.getField("indexno").value;
this.getField("indexno").value = util.printf("%05d", (v+1));

this.exportAsFDF({cPath: "/c/FDFdata/noSerie/indexno_data.fdf", aFields:["indexno"]});
}
app.endPriv();
}

 

--> end file

 

From button in the document I call 

Trusted_handleIndexNo();

But it fails in the Reader-app, but running on Acrobat Pro DC.

Fail: RangeError: Invalid argument value. Doc.exportAsFDF

 

Can anyone point me in the right direction, please?

 

This topic has been closed for replies.

1 reply

Legend
July 7, 2020

See the JS API Reference (picture)

Altien.dkAuthor
Participant
July 7, 2020

Thank you Test_Screen

 

Didn't notice that.

If I read the manual correct, I can buy Acrobat Standard 2020 as a single program, and it will work there?

 

 

try67
Community Expert
Community Expert
July 7, 2020

Yes.