We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Grouping annotation is not supported using ImportAnnotationsFromXfdf

Dear Aspose,


When I group several annotations, e.g. sticky notes, by multiple select the annotations, and right-click on one of the annotation on the document (not on the Comments pane) and click Group, and save the PDF file, export the annotations using ExportAnnotationsXfdf function, it works fine. But when I re-import the xfdf file onto a clean PDF file using ImportAnnotationsFromXfdf function, the grouping is discarded. I’m using Aspose.PDF version 8.0

Here I’ve made a code sample for your review:

License vLicense = new License();
vLicense.SetLicense(“Aspose.Total.lic”);

Enum[] annoType = {
AnnotationType.Highlight,
AnnotationType.Underline,
AnnotationType.Caret,
AnnotationType.Circle,
AnnotationType.FileAttachment,
AnnotationType.FreeText,
AnnotationType.Ink,
AnnotationType.Line,
AnnotationType.Link,
AnnotationType.Movie,
AnnotationType.Polygon,
AnnotationType.PolyLine,
AnnotationType.PrinterMark,
AnnotationType.Screen,
AnnotationType.Sound,
AnnotationType.Square,
AnnotationType.Squiggly,
AnnotationType.Stamp,
AnnotationType.StrikeOut,
AnnotationType.Text,
AnnotationType.TrapNet,
AnnotationType.Watermark,
AnnotationType.Widget
};

FileStream fs1 = new FileStream(Server.MapPath(“TempFolder/AnnotFileGroup.xfdf”), FileMode.OpenOrCreate);

PdfAnnotationEditor AnnEdit = new PdfAnnotationEditor();
AnnEdit.BindPdf(Server.MapPath(“TempFolder/SourceWithGroup.pdf”));
AnnEdit.ExportAnnotationsXfdf(fs1, 1, 1, annoType);

fs1.Close();

PdfAnnotationEditor AnnEdit2 = new PdfAnnotationEditor();
AnnEdit2.BindPdf(Server.MapPath(“TempFolder/Source.pdf”));
AnnEdit2.ImportAnnotationFromXfdf(Server.MapPath(“TempFolder/AnnotFileGroup.xfdf”), annoType);

AnnEdit2.Save(Server.MapPath(“TempFolder/SourceWithGroupResult.pdf”));

And I’m attaching the Source.pdf and SourceWithGroup.pdf files for your further handling.

When you run the code, the AnnotFileGroup.xfdf is perfectly created. But when you open the SourceWithGroupResult.pdf, the grouped stickies are separated.

And when you export the annotations from SourceWithGroupResult.pdf into an xfdf file, if you compare it with AnnotFileGroup.xfdf, you will find that inreplyto attribute is missing in the result xfdf that makes the grouped annotations are separated.

Please kindly your help to fix this issue.

Thank you,
Erwin

Hi Erwin,


Thanks for your inquiry. While testing the scenario with Aspose.Pdf for .NET 8.0, I’ve managed to observe the reported issue and logged as PDFNEWNET-35386 in our issue tracking system for further investigation and resolution. We will notify you via this forum thread as soon as it is resolved.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-35386) have been fixed in Aspose.Pdf for .NET 9.7.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.