Other PDF Issues

How to Import XFDF Data from a Web Server into Acrobat PDF

Olivia MillerOlivia Miller Nov 3, 2026 868 views

Question details

The user is unable to import XFDF data into an Acrobat PDF form when the file is hosted on a web server generated by PHP, despite it working with local files.

How to Import XFDF Data from a Web Server into an Acrobat PDF
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Attempting to populate a PDF form dynamically using XFDF data generated by a server-side script.
Observed behavior
The importAnXFDF() method fails when using a server URL, though it successfully imports XFDF data from local file paths.
Before you start

Ensure you have access to edit the JavaScript in your PDF form and that your web server is properly configured to return data with the correct XFDF content type.

Solution 1Recommended

Replace importAnXFDF() with doc.submitForm()

Since importAnXFDF() is restricted to local file paths, doc.submitForm() must be used to interact with web servers and retrieve HTTP response data.

The importAnXFDF() method is strictly designed for the local file system. To import data from a web server, you must use doc.submitForm() instead. By default, this function performs an HTTP POST request, but it can also execute a GET request. The server must return the XFDF data directly in the HTTP response body.

1
Modify PDF JavaScript

Open your PDF form in Adobe Acrobat, access the JavaScript editor, and replace the importAnXFDF() call with doc.submitForm({ cURL: 'YOUR_SERVER_URL' });.

2
Configure server response

Update your server-side script (such as PHP or Node.js) to output the generated XFDF data directly into the HTTP response body.

3
Set appropriate HTTP headers

Ensure your server sets the correct Content-Type header (e.g., application/vnd.adobe.xfdf) so Acrobat correctly interprets the incoming data.

Replace importAnXFDF() with doc.submitForm()
Acrobat Security: Acrobat's enhanced security settings or trusted location policies might block network access. Ensure your server URL is added to the trusted sites in Acrobat's preferences if you encounter permission errors.
Free Microsoft Office alternative

Edit and Manage PDF Forms Easily with WPS Office

While scripting server-side XFDF data imports requires advanced Acrobat JavaScript features, for everyday PDF form editing, creating, and filling, WPS Office offers a comprehensive, lightweight, and cost-effective solution.

  1. 1. Download and install: Visit the official WPS Office website and download the free desktop application.
  2. 2. Open your PDF: Launch WPS Office and drag your PDF form into the workspace to open it.
  3. 3. Edit and fill forms: Use the dedicated PDF toolkit to interact with form fields, add annotations, or modify text directly.
Easily fill, edit, and save PDF forms without complex JavaScript debugging.Seamless compatibility with standard PDF and Microsoft Office formats.Lightweight software with an intuitive, familiar user interface.Built-in seamless document conversion between PDF, Word, Excel, and PowerPoint.
microsoft office alternative - wps office

Frequently Asked Questions

Why does importAnXFDF() work locally but not on a server?

The importAnXFDF() function in Acrobat JavaScript is explicitly designed for the local file system. It expects a local file path and does not support HTTP or HTTPS network requests.

What HTTP method does doc.submitForm() use?

By default, doc.submitForm() uses a POST request. However, it can be configured to use a GET request by adjusting the parameters in your JavaScript call.

Why is my Acrobat PDF blocking the server connection?

Adobe Acrobat has built-in security features that prevent unauthorized network access. You may need to add your server's domain to the 'Privileged Locations' or 'Trusted Sites' within Acrobat's Security (Enhanced) preferences.