annotation.GetUniqueID() returns null when XFDF contains "name" attribute

Product: PDFTronDotNet

Product Version: 11.3.0

Please give a brief summary of your issue:
When loading annotations from an XFDF file using Apryse (PDFNet), an issue is observed where calling annotation.GetUniqueID() returns null even though the XFDF annotation includes a valid name attribute.

sample xfdf

<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
	<annots>
		<square flags="print" date="D:2026022720053400'00'" name="a89138df349cfd21-275cfcd5e691b054" page="0" rect="8.0876,589.943,231.612,677.854" title="john">
			<contents>Group</contents>
		</square>

</annots>
<pages>
	<defmtx matrix="1.333333,0.000000,0.000000,-1.333333,0.000000,1056.000000" />
</pages>
<pdf-info import-version="4" version="2" xmlns="http://www.pdftron.com/pdfinfo" />

</xfdf>

Steps to Reproduce:

  1. Load a PDF document using Apryse.

  2. Import or process the above XFDF annotation.

  3. Retrieve the annotation from the PDF.

  4. Call:annotation.GetUniqueID();

  5. Observe that the result is null.

Expected Behavior:

annotation.GetUniqueID() should return the value of the XFDF name attribute: a89138df349cfd21-275cfcd5e691b054

Actual Behavior:

annotation.GetUniqueID() returns null.

1 Like

Hi Priya,

Thank you for reaching out.

Could you give us a full snippet showing how you are using the API.
getUniqueID is expecting a PDFNET Annot not an Annotation.

Have you read this guide?

Could you provide the file you used for that annotation? Importing it on our sample file is not enough.

Best Regards,
Mickaël.

1 Like