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)
{
anno.Flatten();
}
}
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)