Skip to main content
cruzj89645772
Participating Frequently
January 6, 2017
Question

Is it possible saving xfdf file in Reader ?

  • January 6, 2017
  • 2 replies
  • 943 views

The script for saving xfdf file works fine in Pro but with Reader I get the error:

RangeError: Invalid argument value.
Doc.exportAsXFDF:20:Field Button3:Mouse Up

The config.js file (for Reader):

myTrustedReadFile = app.trustedFunction( function ( oArgs )
{
app.beginPriv();
var rStream = util.readFileIntoStream(oArgs);
var cFile = util.stringFromStream(rStream);
app.endPriv();
return cFile;
});

myTrustedExportXFDF = app.trustedFunction( function ( oArgs )
{
app.beginPriv();
this.exportAsXFDF(true,true,null,oArgs)
app.endPriv();
return true;
});

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

And myTrstedReadFile Works fine (in Pro and Reader)

Thanks for your time.

This topic has been closed for replies.

2 replies

Inspiring
January 6, 2017

This won't work with Reader. It requires that the import/export form data usage right is applied to the document, which can only be done with LiveCycle Reader Extensions.

try67
Community Expert
Community Expert
January 6, 2017

You should specify each parameter explicitly. In the documentation the

fourth parameter for this method is cPath, but you seem to pass something

else to it (oArgs, whatever that is).

On Fri, Jan 6, 2017 at 12:07 PM, cruzj89645772 <forums_noreply@adobe.com>

cruzj89645772
Participating Frequently
January 6, 2017

Sorry, I didn't show the javascript button:

myTrustedExportXFDF("/c/temp/infoturno.xfdf");

oArgs is the path + filename I want to save.

Nevertheless I changed config.js and now I have:

...

this.exportAsXFDF(true,true,null,"/c/temp/infoturno.xfdf");

...

The error is the same.

try67
Community Expert
Community Expert
January 6, 2017

You should do it like this:

this.exportAsXFDF({bAllFields: true, bNoPassword: true, aFields: null, cPath: "/c/temp/infoturno.xfdf"});

There are a couple of issues there. First of all, why are you specifying the aFields parameter as null? That means that no fields will be exported. Is that what you want? If not, just drop that parameter entirely.

Also, I'm not sure you'll be able to use this command in Reader, unless your file has some special rights applied to it. You need to consult the documentation for this method carefully.