Hi. I am trying to add redaction annotation in code and apply them in Adobe Pro. But when I click the Apply button in Adobe, all the added redaction annotations disappear. When I do redaction directly in Adobe after applying everything ok (redaction annotation stay in document).
Source file: SAE Narrative.pdf (83.2 KB)
Result: result.pdf (84.2 KB)
Demo: demo.gif (1.3 MB)
Java version: 11
Aspose PDF version: 21.11
Code snippet
@Test
void testAdobeRedactionApply() {
var document = new Document("SAE Narrative.pdf");
var page = document.getPages().get_Item(1);
var redactionRectangle = new Rectangle(248.7, 589.416, 292.08, 602.616);
var annotation = new RedactionAnnotation(page, redactionRectangle);
annotation.setFillColor(Color.parse("#9bcbeb"));
annotation.setOverlayText("PI");
annotation.setRepeat(false);
annotation.flatten();
page.getAnnotations().add(annotation);
document.save("result.pdf");
Did I do something wrong when adding the annotation? Maybe I haven’t added any annotation properties?