Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Changed config.js to your version but still getting the same error.
API reference says the meaning of aFields: null is to get all the fields.
This javascript is executing fine in Pro, I have only problems with Reader.
API mention the doc should have form rights.
How can I add form rights to the doc ?
Copy link to clipboard
Copied
Yes, form rights are required for this to work in Reader. However, it's not always very clear what that means, unfortunately.
You can try Reader Enabling the file in Acrobat (via File - Save As Other - Reader Extended PDF - Enable More Tools), but I don't think that would work... I think it requires applying a right using one of the LiveCycle server applications.
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now