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

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

Community Beginner ,
Nov 12, 2018 Nov 12, 2018

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:

error.PNG

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.

error 2.PNG

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.

4.0K
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

correct answers 1 Correct answer

Community Beginner , Nov 13, 2018 Nov 13, 2018

I managed to fix it.

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

Translate
Community Expert ,
Nov 13, 2018 Nov 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();

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 Beginner ,
Nov 13, 2018 Nov 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.

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 ,
Nov 13, 2018 Nov 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.

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 Beginner ,
Nov 13, 2018 Nov 13, 2018

Hmm, that's odd because I've moved my file into the adobe install file and changed my script to:

function importXFDF()

{

    var xfdfURL = "/C/Program Files (x86)/Adobe/Acrobat Reader DC/Reader/file.xfdf";

    this.importAnXFDF(xfdfURL);

}

importXFDF();

This actually works. So I'm thinking there is some kind of permissions conflict with my users folder...

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 ,
Nov 13, 2018 Nov 13, 2018

What do you mean by "adobe install file", exactly?

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 Beginner ,
Nov 13, 2018 Nov 13, 2018

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.

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 Beginner ,
Nov 13, 2018 Nov 13, 2018

I managed to fix it.

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

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 ,
Nov 13, 2018 Nov 13, 2018

That's really strange, but thanks for the update!

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 Beginner ,
Nov 13, 2018 Nov 13, 2018
LATEST

Yeah it is definitely strange, but I'm glad it's working now.

Thanks for your help!

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