Missing field "coords" of link annot while importing XFDF

Hello,

I tried importing and exporting XFDF and found that the field “coords” of link annot was missing.

My test code:

    const xfdf = `<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
	<annots>
		<link style="solid" width="0" flags="print" date="D:20240516073420Z" name="ectd-038ad39c-5f39-46bd-829d-6553868268a6" page="0" coords="89,756.503,106.8471,756.503,106.8471,766.1527,89,766.1527,89,740.903,106.8471,740.903,106.8471,750.5527,89,750.5527" rect="89,740.903,106.8471,766.1527">
			<OnActivation>
				<Action Trigger="U">
					<GoToR>
						<File OriginalName="a.pdf" />
						<Dest>
							<XYZ Zoom="0" Top="841.9" Left="2.29949" Page="1" />
						</Dest>
					</GoToR>
				</Action>
			</OnActivation>
		</link>
	</annots>
	<pages>
		<defmtx matrix="1.333333,0.000000,0.000000,-1.333333,0.000000,1122.533333" />
	</pages>
	<pdf-info import-version="4" version="2" xmlns="http://www.pdftron.com/pdfinfo" />
</xfdf>
`

    await annotManager.importAnnotations(xfdf);
    console.log(await annotManager.exportAnnotations({links: true}));

Output result:

<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><pdf-info xmlns="http://www.pdftron.com/pdfinfo" version="2" import-version="4" /><fields /><annots><link page="0" rect="89,740.903,106.8471,766.1527" flags="print" name="ectd-038ad39c-5f39-46bd-829d-6553868268a6" date="D:20240516073420Z" width="0" style="solid"><OnActivation><Action Trigger="U"><GoToR><File OriginalName="a.pdf"/><Dest><XYZ Page="1" Zoom="0" Left="2.29949"/></Dest></GoToR></Action></OnActivation></link></annots><pages><defmtx matrix="1,0,0,-1,0,841.9" /></pages></xfdf>
1 Like