Free Support Forum - aspose.com

PDF Redaction of adobe markup

Hello

I have found some references to using the Redact() method on PDF annotations but I can’t seem to find them in the code. Is it a dot-net version only feature ?

What we are wanting to do is automate applying the redactions for a document that has been marked up using Adobe Pro. Is this something we can do using Aspose PDF for Java ?

@BartMorse

Thank you for contacting support.

Redact method is exposed by Annotation class which can be called in .NET and Java API alike. Please ensure using Aspose.PDF for Java 18.8 API and you can annotate any content on a PDF page by using the code snippet below:

Document doc = new Document( dataDir +  "Test.pdf");
Rectangle rect = new Rectangle(200, 500, 300, 600);
RedactionAnnotation annot = new RedactionAnnotation(doc.getPages().get_Item(1), rect);
annot.setFillColor(Color.getBlack());
annot.setBorderColor(Color.getYellow());
annot.setColor(Color.getBlue());
annot.setOverlayText("REDACTED");
annot.setTextAlignment(HorizontalAlignment.Center);
annot.setRepeat(true);
annot.redact();
doc.getPages().get_Item(1).getAnnotations().add(annot);
doc.save( dataDir + "Redaction_18.8.pdf");

We hope this will be helpful. Please feel free to contact us if you need any further assistance.

1 Like