Annotation Flatten() doesn't work

We use Flatten() function to burn annotations into pdf file, it doesn’t happen as expect. No result comes out.


example is below, version is 8.4.1

string pdfPath = “trr.pdf”;
Document doc = new Document(pdfPath);
for (int i = 1; i <= doc.Pages.Count && i < 5; i++)
{
Aspose.Pdf.Page page = doc.Pages[i];
List annotations = new List();
for (int j = 1; j <= page.Annotations.Count && j < 5; j++)
annotations.Add(page.Annotations[j]);
foreach (Annotation annot in annotations)
{
annot.Flatten();
}
}
doc.Save(“flatten.pdf”);

Hi Bin,


Thanks for your inquiry. I have tested the scenario using Aspose.Pdf for .NET 9.9.0 using a sample PDF file, but I am afraid I am unable to notice the issue. Please download latest version of Aspose.Pdf for .NET, it will resolve the issue.

Best Regards,

I use Aspose.Pdf for .NET 9.9.0 and get same problem.


Attached is my testing pdf file.

Thanks,
Luo Bin

Hi Bin,


Thanks for sharing the resource file.

When flattening the Annotations inside PDF document, I can see it stays inside the PDF document (however the annotation is not expanded in resultant file) but you can see the annotations icon (Key) in resultant file. Can you please share some details regarding your requirement (how you would like to see the Annotation inside resultant file), so that we can reply accordingly.

For your reference, I have also attached the resultant file generated over my end.

I wish the annotation text is also expanded in resultant file, not just the icon. Is there any way to do it?


Thanks,
Luo Bin

Hi Luo,


Thanks for sharing the details.

I am afraid the above stated feature is currently not supported. However for the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-37955. We will
investigate this requirement in details and will keep you updated on the status of a
implementation. <o:p></o:p>

We apologize for your inconvenience.