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