Call the Save method. Specify the output document path or stream.
The following code snippet shows how to add SquigglyAnnotation to the document:
//Add squiggly annotation to the document from local disk
try(finalAnnotatorannotator=newAnnotator("input.pdf")){SquigglyAnnotationsquigglyAnnotation=newSquigglyAnnotation();squigglyAnnotation.setCreatedOn(newDate());squigglyAnnotation.setFontColor(65535);squigglyAnnotation.setBackgroundColor(16761035);squigglyAnnotation.setMessage("This is squiggly annotation");squigglyAnnotation.setOpacity(0.7);squigglyAnnotation.setPageNumber(0);squigglyAnnotation.setSquigglyColor(1422623);//Supported only Word and PDF
Listpoints=newArrayList<Point>();points.add(newPoint(80,730));points.add(newPoint(240,730));points.add(newPoint(80,650));points.add(newPoint(240,650));Replyreply1=newReply();reply1.setComment("First comment");reply1.setRepliedOn(newDate());Replyreply2=newReply();reply2.setComment("Second comment");reply2.setRepliedOn(newDate());List<Reply>replies=newArrayList<>();replies.add(reply1);replies.add(reply2);squigglyAnnotation.setReplies(replies);annotator.add(squigglyAnnotation);annotator.save("result_squiggly_annotation.pdf");}
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.