Hi,
I have been trying to redact rotated images on pdfs using Aspose.PDF and noticed sometimes some of the image gets missed–the redaction will stop at ~80% of the way through the image. Interestingly this seems to happen inconsistently based on save of the file through a pdf creation tool–after I added another image to the sample doc the rotated image redacted fine, but upon just recreating it, parts of the image were missed in the redaction process.
The same behaviour was present when using facades to redact.
Repro code:
var filePath = @"RotatedImage.pdf";
using (var document = new Document(filePath))
{
var page = document.Pages[1];
var annotation =
new RedactionAnnotation(page, new Rectangle(0, 0, page.CropBox.Width, page.CropBox.Height));
page.Annotations.Add(annotation);
annotation.Redact();
document.Save(@"RedactedFile.pdf");
using (var outputImage = new FileStream(@"RedactedImage.png", FileMode.Create))
{
page.Resources.Images[1].Save(outputImage, ImageFormat.Png);
}
}
Files used:
RotatedImageRedaction.zip (28.4 KB)
Thanks!