Package com.datalogics.PDFL
Class HighlightAnnotation
java.lang.Object
com.datalogics.PDFL.Annotation
com.datalogics.PDFL.TextMarkupAnnotation
com.datalogics.PDFL.HighlightAnnotation
Allows the user to highlight text appearing on a PDF page. The annotated text is still readable on the PDF, but highlighted in yellow.
-
Constructor Summary
ConstructorsConstructorDescriptionHighlightAnnotation(Page page, int addAfter, List<Quad> quadList) Create a new HighlightAnnotation at a specific index in the page's annotation array.HighlightAnnotation(Page page, List<Quad> quadList) Create a new HighlightAnnotation at the end of a page's annotation array. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Generate a new appearance stream with the current annotation properties.Methods inherited from class com.datalogics.PDFL.TextMarkupAnnotation
getAnnotatedText, getAnnotationFeatureLevel, getQuads, setAnnotationFeatureLevel, setQuadsMethods inherited from class com.datalogics.PDFL.Annotation
equals, getColor, getContents, getFlags, getInteriorColor, getNormalAppearance, getOpacity, getOptionalContentMembershipDict, getPDFDict, getRect, getSubtype, getTitle, hasRichTextData, isCurrentlyVisible, setColor, setContents, setFlags, setInteriorColor, setNormalAppearance, setOpacity, setOptionalContentMembershipDict, setRect, setTitle, toString
-
Constructor Details
-
HighlightAnnotation
Create a new HighlightAnnotation at the end of a page's annotation array. To create a FreeTextAnnotation and place it elsewhere in the page's annotation array, use the version of the constructor that takes an array position.- Parameters:
page- The page to which the HighlightAnnotation is added.quadList- A list of quads to highlight. Each quad encompasses a word or group of contiguous words in the text underlying the annotation.
-
HighlightAnnotation
Create a new HighlightAnnotation at a specific index in the page's annotation array.To add the annotation to the end of the array, pass a value of -2 or use the alternate version of this constructor that does not take an index (this is generally what you should do unless you have a need to place the annotation at a special location in the array). Passing a value of -1 adds the annotation to the beginning of the array. Passing other negative values produces undefined results.
- Parameters:
page- The page to which the HighlightAnnotation is added.addAfter- Where to add the annotation in the page's annotation array.quadList- A list of quads to highlight. Each quad encompasses a word or group of contiguous words in the text underlying the annotation.
-
-
Method Details
-
delete
public void delete()- Overrides:
deletein classTextMarkupAnnotation
-
generateAppearance
Generate a new appearance stream with the current annotation properties.The resulting Form can then be used to set the annotation's appearance, such as by calling SetNormalAppearance.
- Overrides:
generateAppearancein classAnnotation
-