0

I have created a pdf form using acrobat with below script.

Below the script:

function importXFDF() {
    var url = "https://<Server>/first-form_data.xfdf";
    this.importAnXFDF(url);
}
importXFDF();

If any users download and open the form i am trying to Prefill the form values from XFDF file using importAnXFDF() function. XFDF file is dynamically created by php script.

The issue is: if i pass any local xfdf file then the values are populated. But it fails if it is server file. Is it possible to import data to pdf form from server?

sathish
  • 6,705
  • 3
  • 30
  • 35

1 Answers1

2

You can't import an XFDF from a URL, only from a local file path. Instead, create an FDF file on your server then in your form, use submitForm where the URL is the URL to your server plus "#FDF". Thi will tell Acrobat to expect an FDF to be returned. Return the FDF using application/vnd.fdf as the mime type. Acrobat should populate the values.

joelgeraci
  • 4,606
  • 1
  • 12
  • 19
  • It works! thanks! Also it is showing popup to choose file. Is there any option to skip? – sathish Jun 06 '20 at 03:45
  • Is the "#FDF" at the end of the URL? That should tell Acrobat to just import the response rather than prompt for a file. – joelgeraci Jun 08 '20 at 18:03