I have a PDF document, and I want to use RedactionAnnotation screenshot to cover part of the top area, but when I execute the following code, the image outside the top covered area is displayed abnormally.
void Main()
{
var doc = new Aspose.Pdf.Document(@"C:\Users\54390\Desktop\月亮.pdf");
var annotationColor = Aspose.Pdf.Color.Green;
foreach (var page in doc.Pages)
{
var annot = new RedactionAnnotation(page, new Aspose.Pdf.Rectangle(0, page.Rect.Height - 56, page.Rect.Width, page.Rect.Height));
annot.FillColor = annotationColor;
annot.Color = annotationColor;
page.Annotations.Add(annot);
annot.Redact();
}
doc.Save(@"C:\Users\54390\Desktop\output.pdf");
}
Sample file
月亮.pdf (546.9 KB)
Screenshot
20230305205248.png (295.6 KB)