# Add resource redaction annotation The page describes how to add resource redaction annotation to a document using GroupDocs.Annotation for Java. Resource redaction annotation fills black rectangle with fixed position to hide a text as shown in the picture below: ![](https://docs.groupdocs.com/annotation/java/images/add-resource-redaction-annotation.png) You can use the following methods to set the properties of the [ResourcesRedactionAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/resourcesredactionannotation) class: * [setBox()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/resourcesredactionannotation/#setBox-com.groupdocs.annotation.models.Rectangle-) defines the annotation on the page To add a resource redaction annotation, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/java/annotation/com.groupdocs.annotation/Annotator) class. Specify the input document path or stream. 2. Instantiate the [ResourceRedactionAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/resourcesredactionannotation) class. Specify the appropriate properties (position, page number, etc). 3. Call the [add()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#add-com.groupdocs.annotation.models.annotationmodels.AnnotationBase-) method. Specify the [ResourceRedactionAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/resourcesredactionannotation) class. 4. Call the [save()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#save--) method. Specify the output document path or stream.  The following code snippet shows how to add [ResourcesRedactionAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/resourcesredactionannotation) to the document: {{< tabs "example1">}} {{< tab "Java" >}} ```java // This example demonstrates adding resources redaction annotation. // Create an instance of Annotator class Annotator annotator = new Annotator("inputPath"); try { // Create an instance of Reply class and add comments Reply reply1 = new Reply(); reply1.setComment("First comment"); reply1.setRepliedOn(Calendar.getInstance().getTime()); Reply reply2 = new Reply(); reply2.setComment("Second comment"); reply2.setRepliedOn(Calendar.getInstance().getTime()); java.util.List replies = new ArrayList(); replies.add(reply1); replies.add(reply2); // Create an instance of ResourcesRedactionAnnotation class and set options ResourcesRedactionAnnotation resourcesRedaction = new ResourcesRedactionAnnotation(); resourcesRedaction.setBox(new Rectangle(100, 100, 100, 100)); resourcesRedaction.setCreatedOn(Calendar.getInstance().getTime()); resourcesRedaction.setMessage("This is resources redaction annotation"); resourcesRedaction.setPageNumber(0); resourcesRedaction.setReplies(replies); // Add annotation and save to file annotator.add(resourcesRedaction); annotator.save("outputPath"); } finally { if (annotator != null) { annotator.dispose(); } } ``` {{< /tab >}} {{< /tabs >}}