annotationManager.exportAnnotCommand() removed parent annotation from xfdf output

Hi there,

Thank you for your response,

Please see below observations:

If you add the following annotationChanged event handler:

const { annotationManager } = instance.Core;

    annotationManager.addEventListener('annotationChanged', (annotations, action) => {
      if (action === 'add') {
        console.log('this is a change that added annotations');
      } else if (action === 'modify') {
        console.log('this change modified annotations');
      } else if (action === 'delete') {
        console.log('there were annotations deleted');
      }

      annotations.forEach((annot) => {
        console.log('annotation page number', annot.PageNumber);
      });
    });

Then create a rectangle annotation then a free text annotation, calling exportAnnotationCommand will give you 2 annotations inside the ‘add’ element of the XFDF:

Afterwards, if I group the 2 annotations, then call exportAnnotationCommand, only one modified event is triggered and you will see that inside the XFDF, there is only one modified element, the freetext (second annotation):

This is why you are not seeing the parent annotation inside the XFDF. As you mentioned, this is the expected behaviour for annotation grouping.

We do not have a way to disable the annotation grouping, however you can simply block that button by hiding the element from the UI:
instance.UI.disableElement('annotationGroupButton')

Best regards,
Kevin Kim