// This example demonstrates adding text redaction annotation.
// Create an instance of Annotator class
Annotatorannotator=newAnnotator("inputPath");try{// Create an instance of Reply class and add comments
Replyreply1=newReply();reply1.setComment("First comment");reply1.setRepliedOn(Calendar.getInstance().getTime());Replyreply2=newReply();reply2.setComment("Second comment");reply2.setRepliedOn(Calendar.getInstance().getTime());java.util.List<Reply>replies=newArrayList<Reply>();replies.add(reply1);replies.add(reply2);Pointpoint1=newPoint(80,730);Pointpoint2=newPoint(240,730);Pointpoint3=newPoint(80,650);Pointpoint4=newPoint(240,650);List<Point>points=newArrayList<Point>();points.add(point1);points.add(point2);points.add(point3);points.add(point4);// Create an instance of TextRedactionAnnotation class and set options
TextRedactionAnnotationtextRedaction=newTextRedactionAnnotation();textRedaction.setCreatedOn(Calendar.getInstance().getTime());textRedaction.setMessage("This is text redaction annotation");textRedaction.setPageNumber(0);textRedaction.setPoints(points);textRedaction.setReplies(replies);// Add annotation and save to file
annotator.add(textRedaction);annotator.save("outputPath");}finally{if(annotator!=null){annotator.dispose();}}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.