Call the Save method. Specify the output document path or stream.
The following code snippet shows demonstrates how to add SearchTextAnnotation to the document:
//Add search text annotation to the document from local disk
try(finalAnnotatorannotator=newAnnotator("input.pdf")){SearchTextFragmentsearchTextFragment=newSearchTextFragment();searchTextFragment.setText("Welcome to GroupDocs");//If the document does not contain this text, nothing will be highlighted
searchTextFragment.setFontSize(10.);searchTextFragment.setFontFamily("Calibri");searchTextFragment.setFontColor(65535);searchTextFragment.setBackgroundColor(16761035);annotator.add(searchTextFragment);annotator.save("result_add_search_text.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.