Call the save() method. Specify the output document path or stream.
The following code snippet shows how to add TextFieldAnnotation to the document:
// This example demonstrates adding text field 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);// Create an instance of TextFieldAnnotation class and set options
TextFieldAnnotationtextField=newTextFieldAnnotation();textField.setBackgroundColor(65535);textField.setBox(newRectangle(100,100,100,100));textField.setCreatedOn(Calendar.getInstance().getTime());textField.setText("Some text");textField.setFontColor(65535);textField.setFontSize((double)12);textField.setMessage("This is text field annotation");textField.setOpacity(0.7);textField.setPageNumber(0);textField.setPenStyle(PenStyle.Dot);textField.setPenWidth((byte)3);textField.setReplies(replies);// Add annotation and save to file
annotator.add(textField);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.