How to find signature annotation

Product:React js

Product Version:“@pdftron/webviewer”: “^10.4.0”

Please give a brief summary of your issue:
issue is when i export xfdf so its give me the xml i provide below
in xml we have fields pdf-info
each field belongs to each ffield and widget
to match it we do field name = ffield name
ffield name = widget field
and widget name has a unique key
now when i sign it and get its annotation export which is this

<annots>
		<ink page="0" rect="316.620,2317,681.409,2458.770" color="#000000" flags="print" name="5e7b5535-1ef8-18db-79e9-994782c09249" title="Guest" subject="Signature" date="D:20240115180126+05'00'" creationdate="D:20240115180126+05'00'">
			<trn-custom-data bytes="{&quot;trn-annot-maintain-aspect-ratio&quot;:&quot;true&quot;}"/>
			<inklist>
				<gesture>318.4430745612908,2456.946925438709;318.4430745612908,2455.1985222630456;320.17933604823446,2449.9533127360555;320.17933604823446,2446.456506384728;325.38812050906535,2437.71449050641;328.86064348295264,2430.720877803756;335.80568943072717,2418.4820555741117;337.5419509176709,2413.2368460471207;344.48699686544535,2404.494830168803;353.1683043001636,2394.0044111148222;361.84961173488176,2385.2623952365047;370.53091916959994,2376.520379358187;384.421011065149,2367.7783634798693;398.3111029606981,2359.036347601552;413.93745634319083,2352.0427348988974;434.77259418651454,2345.049122196244;455.6077320298381,2339.803912669253;476.4428698731618,2332.810299966599;497.2780077164855,2329.313493615272;512.9043610989781,2325.8166872639445;528.5307144814709,2325.8166872639445;537.2120219161892,2325.8166872639445;549.3658523247946,2325.8166872639445;554.5746367856256,2327.565090439608;559.7834212464563,2327.565090439608;568.4647286811746,2332.810299966599;570.2009901681183,2338.055509493589;571.9372516550619,2348.545928547571;573.6735131420055,2355.539541250225;573.6735131420055,2366.029960304206;571.9372516550619,2378.2687825338503;566.7284671942309,2390.507604763495;561.5196827334,2399.249620641813;552.838375298682,2409.740039695794;544.1570678639638,2418.4820555741117;533.7394989423019,2425.475668276765;521.5856685336964,2432.46928097942;505.9593151512038,2435.966087330747;486.8604387948237,2442.959700033401;472.9703468992745,2444.7081032090646;459.0802550037254,2444.7081032090646;450.3989475690073,2444.7081032090646;443.4539016212327,2444.7081032090646;434.77259418651454,2442.959700033401;426.09128675179636,2439.4628936820736;424.35502526485266,2432.46928097942;419.14624080402183,2420.230458749775;417.4099793170782,2411.4884428714577;415.6737178301345,2400.998023817476;415.6737178301345,2392.2560079391587;415.6737178301345,2383.5139920608412;415.6737178301345,2373.0235730068603;415.6737178301345,2369.526766655533;415.6737178301345,2360.784750777216;419.14624080402183,2353.791138074561;422.61876377790907,2345.049122196244;427.82754823874,2339.803912669253;429.56380972568365,2336.3071063179264;429.56380972568365,2332.810299966599;433.0363326995709,2329.313493615272;433.0363326995709,2327.565090439608;434.77259418651454,2325.8166872639445;439.9813786473454,2322.319880912618;443.4539016212327,2320.5714777369544;445.19016310817636,2320.5714777369544;450.3989475690073,2318.823074561291;455.6077320298381,2318.823074561291;459.0802550037254,2318.823074561291;464.28903946455637,2318.823074561291;471.23408541233107,2318.823074561291;479.91539284704913,2318.823074561291;493.8054847425982,2318.823074561291;505.9593151512038,2324.068284088282;525.0581915075836,2329.313493615272;544.1570678639638,2334.558703142263;568.4647286811746,2343.30071902058;589.2998665244983,2346.7975253719073;610.1350043678219,2353.791138074561;627.4976192372583,2357.2879444258883;637.91518815892,2362.5331539528793;648.332757080582,2366.029960304206;653.5415415414129,2371.2751698311968;658.7503260022438,2373.0235730068603;665.6953719500184,2376.520379358187;672.6404178977928,2380.017185709514;676.1129408716802,2381.7655888851777;677.8492023586239,2383.5139920608412;679.5854638455675,2383.5139920608412</gesture>
			</inklist>
		</ink>
	</annots>

so how can i match that this annotation ink belong to that particular widget

this is my complete xml

<?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">
		<ffield type="Sig" name="Jack" flags="Required" />
		<widget appearance="_DEFAULT" field="Jack" name="f997643c-38bf-cee7-0643-440c8ef08b57" modified-date="D:20240115180123+05'00'" page="1">
			<rect x1="316.62" x2="845.89" y1="2317" y2="2458.77" />
			<border style="null" />
			<trn-custom-data bytes="{&quot;trn-signature-type&quot;:&quot;fullSignature&quot;,&quot;trn-form-field-indicator-text&quot;:&quot;Sign Here Jack&quot;,&quot;trn-form-field-show-indicator&quot;:&quot;true&quot;}" />
		</widget>
	</pdf-info>
	<fields>
		<field name="Jack">
			<value></value>
		</field>
	</fields>
	<annots>
		<ink page="0" rect="316.620,2317,681.409,2458.770" color="#000000" flags="print" name="5e7b5535-1ef8-18db-79e9-994782c09249" title="Guest" subject="Signature" date="D:20240115180126+05'00'" creationdate="D:20240115180126+05'00'">
			<trn-custom-data bytes="{&quot;trn-annot-maintain-aspect-ratio&quot;:&quot;true&quot;}"/>
			<inklist>
				<gesture>318.4430745612908,2456.946925438709;318.4430745612908,2455.1985222630456;320.17933604823446,2449.9533127360555;320.17933604823446,2446.456506384728;325.38812050906535,2437.71449050641;328.86064348295264,2430.720877803756;335.80568943072717,2418.4820555741117;337.5419509176709,2413.2368460471207;344.48699686544535,2404.494830168803;353.1683043001636,2394.0044111148222;361.84961173488176,2385.2623952365047;370.53091916959994,2376.520379358187;384.421011065149,2367.7783634798693;398.3111029606981,2359.036347601552;413.93745634319083,2352.0427348988974;434.77259418651454,2345.049122196244;455.6077320298381,2339.803912669253;476.4428698731618,2332.810299966599;497.2780077164855,2329.313493615272;512.9043610989781,2325.8166872639445;528.5307144814709,2325.8166872639445;537.2120219161892,2325.8166872639445;549.3658523247946,2325.8166872639445;554.5746367856256,2327.565090439608;559.7834212464563,2327.565090439608;568.4647286811746,2332.810299966599;570.2009901681183,2338.055509493589;571.9372516550619,2348.545928547571;573.6735131420055,2355.539541250225;573.6735131420055,2366.029960304206;571.9372516550619,2378.2687825338503;566.7284671942309,2390.507604763495;561.5196827334,2399.249620641813;552.838375298682,2409.740039695794;544.1570678639638,2418.4820555741117;533.7394989423019,2425.475668276765;521.5856685336964,2432.46928097942;505.9593151512038,2435.966087330747;486.8604387948237,2442.959700033401;472.9703468992745,2444.7081032090646;459.0802550037254,2444.7081032090646;450.3989475690073,2444.7081032090646;443.4539016212327,2444.7081032090646;434.77259418651454,2442.959700033401;426.09128675179636,2439.4628936820736;424.35502526485266,2432.46928097942;419.14624080402183,2420.230458749775;417.4099793170782,2411.4884428714577;415.6737178301345,2400.998023817476;415.6737178301345,2392.2560079391587;415.6737178301345,2383.5139920608412;415.6737178301345,2373.0235730068603;415.6737178301345,2369.526766655533;415.6737178301345,2360.784750777216;419.14624080402183,2353.791138074561;422.61876377790907,2345.049122196244;427.82754823874,2339.803912669253;429.56380972568365,2336.3071063179264;429.56380972568365,2332.810299966599;433.0363326995709,2329.313493615272;433.0363326995709,2327.565090439608;434.77259418651454,2325.8166872639445;439.9813786473454,2322.319880912618;443.4539016212327,2320.5714777369544;445.19016310817636,2320.5714777369544;450.3989475690073,2318.823074561291;455.6077320298381,2318.823074561291;459.0802550037254,2318.823074561291;464.28903946455637,2318.823074561291;471.23408541233107,2318.823074561291;479.91539284704913,2318.823074561291;493.8054847425982,2318.823074561291;505.9593151512038,2324.068284088282;525.0581915075836,2329.313493615272;544.1570678639638,2334.558703142263;568.4647286811746,2343.30071902058;589.2998665244983,2346.7975253719073;610.1350043678219,2353.791138074561;627.4976192372583,2357.2879444258883;637.91518815892,2362.5331539528793;648.332757080582,2366.029960304206;653.5415415414129,2371.2751698311968;658.7503260022438,2373.0235730068603;665.6953719500184,2376.520379358187;672.6404178977928,2380.017185709514;676.1129408716802,2381.7655888851777;677.8492023586239,2383.5139920608412;679.5854638455675,2383.5139920608412</gesture>
			</inklist>
		</ink>
	</annots>
	<pages>
		<defmtx matrix="1,0,0,-1,0,2851" />
		<pgmtx matrix="1,0,0,-1,0,900" page="1" />
		<pgmtx matrix="1,0,0,-1,0,900" page="2" />
		<pgmtx matrix="1,0,0,-1,0,900" page="3" />
		<pgmtx matrix="1,0,0,-1,0,900" page="4" />
		<pgmtx matrix="1,0,0,-1,0,900" page="5" />
		<pgmtx matrix="1,0,0,-1,0,900" page="6" />
		<pgmtx matrix="1,0,0,-1,0,900" page="7" />
		<pgmtx matrix="1,0,0,-1,0,900" page="8" />
		<pgmtx matrix="1,0,0,-1,0,900" page="9" />
		<pgmtx matrix="1,0,0,-1,0,900" page="10" />
		<pgmtx matrix="1,0,0,-1,0,900" page="11" />
		<pgmtx matrix="1,0,0,-1,0,900" page="12" />
		<pgmtx matrix="1,0,0,-1,0,900" page="13" />
		<pgmtx matrix="1,0,0,-1,0,900" page="14" />
		<pgmtx matrix="1,0,0,-1,0,900" page="15" />
		<pgmtx matrix="1,0,0,-1,0,900" page="16" />
		<pgmtx matrix="1,0,0,-1,0,900" page="17" />
	</pages>
</xfdf>```
1 Like

Hello Huzeifa,

To clarify, are you trying to associate the ink in annots with the original widget that has the name Jack?

You can use the setCustomData API to do this.

Once you sign the widget, you can get the signature and set it like so:

setCustomData('name,'Jack');

This will add the Jack to the trn-custom-data tag.

    <annots>
        <ink page="0" rect="199.26,574.687,413.32,594.024" color="#000000" flags="print"
            name="fb43dc5c-1b95-41f8-f33e-e8628a17fa99" title="Guest" subject="Signature" date="D:20240116125259-05'00'"
            creationdate="D:20240116125245-05'00'"><trn-custom-data
                bytes="{&quot;trn-annot-maintain-aspect-ratio&quot;:&quot;true&quot;,&quot;trn-signature-type&quot;:&quot;fullSignature&quot;,&quot;trn-associated-number&quot;:&quot;2&quot;,
                &quot;name&quot;:&quot;Jack&quot;}" />
            <inklist>

Best Regards,
Darian

1 Like

Thank you very much for the help, But i managed it from different way .

2 Likes