These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Invalid data in a xfdf file

gchiu
Registered: Mar 11 2009
Posts: 9

I've noticed that some characters appear to cause Acrobat to fail to load the xfdf data.

Eg the "&" if it is used in a form field.

Is there any way around this?

My Product Information:
Acrobat Pro 9.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You do know that the ampersand is a special character in XML, and of course that the XFDF format is an XML gramar? Get youself a book on XML. It'll list all the special characters and the escape sequences.

However, when Acrobat exports XFDF data it escapes all special characters, i.e., "&" goes to "&". So this should not be a problem for data exported from Acrobat. In fact exporting data as XFDF from Acrobat will show you how various special characters need to be escaped.If you are generating an XFDF to import into a Form, then the application that generates the XFDF needs to escape the special characters.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

gchiu
Registered: Mar 11 2009
Posts: 9
Actually this is data generated from an Acrobat form. And yes, the & is escaped by Acrobat, but still causes Acrobat to fail to parse the XML.I guess it doesn't help that & is used to escape characters.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I just did some tests exporting and then importing XFDF from a PDF. Fields containing "&" and other special characters didn't have a problem.Is this an AcroForm or a LiveCycle form?
Can you provide the exact steps for reproducing the issue?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

gchiu
Registered: Mar 11 2009
Posts: 9
It's an Acroform, and what I am doing is submitting the data to a web server.
But the problem occurred when I try and view filled in forms where there were special characters in the field names, or in the posted data.

The web server is supposed to be just retrieving the posted data, but perhaps it is decoding the escaping prior to storing the data ... and not re-encoding when retrieving it. I shall have to investigate further.

Good to know that your tests show it does work.