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 & 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);
});