Hi! We have issues with redaction where the redact annotations bleed into other pages. We have tested with both Aspose.PDF 24.8, 24.9 and 24.10.
Test with PDF document from Testfile.org https://testfile.org/all-pdf-sample-test-file-download-direct/.
When I redact this using RedactionAnnotation.Redact() method, this is the result.
image.png (52.0 KB)
It seems like a redaction on page 1, bleeds into page 2, and vice versa.
Relevant code:
public Stream RedactPdfDocument(Stream pdfDocument, List<RedactionCoordinate> redactionCoordinates, string overlay = null)
{
var document = new Document(pdfDocument);
foreach (var redactionCoordinate in redactionCoordinates)
{
var pageNr = redactionCoordinate.PageNr;
var rectangle = new Rectangle(
redactionCoordinate.LLX,
redactionCoordinate.LLY,
redactionCoordinate.URX,
redactionCoordinate.URY);
var redactionAnnotation = new RedactionAnnotation(document.Pages[pageNr], rectangle)
{
FillColor = Color.Black,
BorderColor = Color.Black,
Color = Color.Black,
};
document.Pages[pageNr].Annotations.Add(redactionAnnotation, true);
redactionAnnotation.Redact();
}
var memoryStream = new MemoryStream();
document.Save(memoryStream);
return memoryStream;
}