ICEpdf Viewer RI allows users to create link annotations using a visual editor. The editor allows for quick edits and simple annotation additions but becomes tedious when working with large document sets. ICEpdf's Core API provides a mechanism which enables WordText objects returned from a document search to be converted to Link Annotations.
The Annotation Example contains two approaches for converting search results into Link Annotations. The following code snippet show how search results are iterated over to create Link annotations.
The source-code for the example is located at install_dir/icepdf/examples/annotation/NewAnnotationPostPageLoad.java.
The source-code for the example is located at install_dir/icepdf/examples/annotation/NewAnnotationPrePageLoad.java.
Search results can also be in the form of List<LineText> which is handy when trying to create single annotation over multiple WordText objects. The method searchController.searchHighlightPage(int, int):List<LineText> returns a line of text with an optional padding of words that are on either side of the search terms in context of the document content. When the padding is set to a value of zero the LineText list contains child WordText objects that represent the search terms. When a call to lineText.getBounds() is called the bounding box represent the union of all terms.
The following code snippet shows how annotation can be create around mutliple search terms.
© Copyright 2017 ICEsoft Technologies Canada Corp.