Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is it possible saving xfdf file in Reader ?

New Here ,
Jan 06, 2017 Jan 06, 2017

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.

TOPICS
Acrobat SDK and JavaScript
860
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2017 Jan 06, 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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 06, 2017 Jan 06, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2017 Jan 06, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 06, 2017 Jan 06, 2017

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 ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2017 Jan 06, 2017

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 06, 2017 Jan 06, 2017
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines