Hi Slavko,
Interestingly this is the expected behavior as even though we call widgets annotations in our API they are technically not annotations. You can see this reflected in the XFDF you shared the annots tag is empty <annots/>
We don’t have an API to get the XFDF for one widget but we can use DOMParser
to parse out a specific widget from the XML
Here’s a code snippet of that:
const annots = annotManager.getAnnotationsList();
const singleAnnot = annots.find(annot => annot instanceof Annotations.WidgetAnnotation);
const name = singleAnnot.fieldName
const xfdf = await annotManager.exportAnnotations({
annotList: [singleAnnot],
widgets: true,
links: true,
fields: true,
})
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xfdf, "text/xml");
console.log(xmlDoc.querySelector(`ffield[name='${name}']`));
Cheers,
Dustin