Redact certain page region with RedactionAnnotation
Aspose.PDF for Java supports the feature to add as well as manipulate Annotations in an existing PDF file. Recently some of our customers requested the Redaction feature, to redact (remove text, image, etc elements from) certain page region of PDF document. In order to fulfill this requirement, a class named RedactionAnnotation is provided, which can be used to redact certain page region or it can be used to manipulate existing RedactionAnnotations and redact them (i.e. flatten annotation and remove the text under it).
In order to redact a page region with RedactionAnnotation, the following steps can be used.
- Create a new object of Document class
- Define a Rectangle object with desired region parameters
- Create an object of RedactionAnnotation with page information
- Add annotation to the desired page of Document object
- Save the document
com.aspose.pdf.facades namespace also has a class named PdfAnnotationEditor which provides the feature to manipulate existing Annotations inside PDF file. This class contains a method named redactArea(..) which provides the capability to remove certain page regions.