[WebViewer] Facing issue with custom annotation

Hi

we are adding a stamp annotation and attaching a link to that stamp annotation. That works perfectly fine.

Following is the code:
var stampAnnot = new annotations.StampAnnotation();
var link = new annotations.Link();
var linkHref = new currentPDFTronInstance.Actions.URI({
uri: element.dataset.wplink,
});
link.addAction(
‘U’,
linkHref
);

stampAnnot.associateLink([link.Id]);
annotManager.updateAnnotation(link);
annotManager.addAnnotation(link);
annotManager.redrawAnnotation(link);
annotManager.drawAnnotations(docViewer.getCurrentPage(), null, true);

Now we facing an issue on adding the annotation, on adding, we are getting two xmls. One for stamp annotation and other link annotation. But after dragging we get a single annotation with link annotation as child.

How we can add link annotation to stamp Annotation as child on adding, just like on dragging.

Attached are the two XMLS on adding and other on dragging.

afterDragXML.xml (2.64 KB)

addTimeXML.xml (2.29 KB)

Hello,

The behaviour you are seeing is what is expected. A link annotation is separate from the stamp annotation, and are simply linked together when you call associateLink. I am not sure quite what you mean by child annotation, but if you are referring to the following, it is simply how we link the two internally:

<trn-custom-data bytes**="{“trn-link-id”:[“471713f4-40a1-b0cf-40b3-8c013c0f614d”]}"/>**

This links the ID of the Link Annotation to your Stamp Annotation. The link annotation still exists as XFDF and you can verify by exporting the XFDF of the document.

It seems to me that you are doing things correctly.

Best Regards,
Armando Bollain
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

CONFIDENTIALITY NOTICE: This message (and any attachment to it) is intended only for the use of the individual or entity to which it is addressed in the header, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any reproduction, distribution, modification or use of the contents of this message (and any attachment to it) by any individual or entity other than the intended recipient is prohibited. If you have received this communication in error, please notify us immediately and delete the original.