Field values not encoded properly

PDF.js Express Version
7.0.1

Detailed description of issue
XFDF created by exporting annotations does not produce proper XML encoded field values.

Example xfdf string produced with invalid xml encoding:
<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><fields><field name="FLD_CUSTOMER_BANK_NAME"><value>Test Bank & Trust</value></field></fields><annots /><pages><defmtx matrix="1,0,0,-1,0,792" /></pages></xfdf>

Notice & value in FLD_CUSTOMER_BANK_NAME value

Expected behaviour
Field values should have XML entities encoded properly so other XML parsers can consume the data.

Expected XML:
<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><fields><field name="FLD_CUSTOMER_BANK_NAME"><value>Test Bank &amp; Trust</value></field></fields><annots /><pages><defmtx matrix="1,0,0,-1,0,792" /></pages></xfdf>

Does your issue happen with every document, or just one?
All documents

Link to document
n/a

Code snippet
viewer.viewerInstance.annotManager.exportAnnotations({ links: false, widgets: false }).then(function (x) {
console.log(“xfdf data=” + x);
});

Hi there,

We can not reproduce this issue on our end. Would you be able to send us the file you tested with?

Thanks!
Logan

My apologies, Logan.

It does appear that when getting the xfdf data from the document the field value are encoded properly. I guess there’s something else going on between the submission and recording of this data I need to track down.

Thanks for the reply.

1 Like