Skip to main content
Inspiring
November 13, 2018
Answered

Importing .xfdf does not work in Reader, whereas it works perfectly in Acrobat Pro

  • November 13, 2018
  • 1 reply
  • 4135 views

Hi,

I have written a script in Acrobat Pro that automatically imports a .xfdf file to fill in a form. It works perfectly when I open the form in Acrobat Pro.

Here is the script:

function importXFDF()

{

    var url = "C:/Users/maarmstrong/Documents/AcrobatStuff/file.xfdf";

    this.importAnXFDF(url);

}

importXFDF();

However, when I try open this form in Adobe Reader, it gives the following two pop-up boxes:

The box above makes sense, just click "Allow". However, the file path looks strange to me, as if it's not pointing to the right location.

Again, the location looks odd. It should look like: C:/Users/maarmstrong/Documents/AcrobatStuff/file.xfdf

I am unsure why this is happening.

Any help will be greatly appreciated.

This topic has been closed for replies.
Correct answer qldreception

Sorry I meant the install location, as in where the executable lives in Program Files (x86).

I have played around more, however, and if I have the .xfdf file in "/C/Users/" I do not encounter the error. However, as soon as I put the .xfdf file into my user folder "/C/Users/maarmstrong/" I immediately encounter the error. Again, this leads me to believe there is an issue with permissions in Reader.


I managed to fix it.

All that was needed was to go into Edit>Preferences>Security(Enhanced) and uncheck "Enable Protected Mode at Starup".

1 reply

try67
Community Expert
Community Expert
November 13, 2018

Your syntax of the file path is incorrect. Also, you should not be declaring a variable called "url" because there's already a property with that name of the Document object, so you're creating a conflict.

Try this, instead:

function importXFDF() {

    var xfdfUrl = "/C/Users/maarmstrong/Documents/AcrobatStuff/file.xfdf";

    this.importAnXFDF(xfdfUrl);

}

importXFDF();

Inspiring
November 13, 2018

Hi,

I was playing around a lot and have tried this, but I get the same result.

I feel that it's a bug within Reader. If I call the function importAnXFDF() in Reader's console without specifying a file location, it brings up a file browser and I can import the file just fine. But if I call importAnXFDF("/C/Users/maarmstrong/Documents/AcrobatStuff/file.xfdf"), then I get the Access Denied error as above.

try67
Community Expert
Community Expert
November 13, 2018

From the documentation of this method:

Note: If the cPath parameter is specified, this method can only be executed during batch and console events.