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

Free Support Forum - aspose.com

Annotations.Flatten() throws ArgumentOutOfRangeException

I am using Asponse.PDF v20.2.0.

MemoryStream memoryStream = GetPDFFileAsStream(@"C:\test.pdf");
Document pdfDocument = new Document(memoryStream);

foreach (var pg in pdfDocument.Pages.Where(p => p.Annotations.Any()))
    foreach (var anno in pg.Annotations)

The ArgumentOutOfRangeException is thrown on the anno.Flatten(); line in the above code snippet.
Here is the PDF I used in the above example: test.pdf (564.2 KB)


I have observed issue you mentioned and have logged it as PDFNET-47786 in our issue tracking system. We will further look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-47786) have been fixed in Aspose.PDF for .NET 21.8.