Class UnderlineAnnotation


public class UnderlineAnnotation extends TextMarkupAnnotation
A type of text markup annotation, for underlining text. Text markup annotations added to a PDF file appear as highlights, underlines, or strikeouts. The Underline Annotation appears PDF document as underlined text when the documnent is opened in a PDF Viewer.
  • Constructor Details

    • UnderlineAnnotation

      public UnderlineAnnotation(Page page, List<Quad> quadList)
      Create a new UnderlineAnnotation 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 UnderlineAnnotation is added.
      quadList - A list of quads to underline. Each quad encompasses a word or group of contiguous words in the text underlying the annotation.
    • UnderlineAnnotation

      public UnderlineAnnotation(Page page, int addAfter, List<Quad> quadList)
      Create a new UnderlineAnnotation at a specific index in the page's annotation array.

      Parameters:
      page - The page to which the UnderlineAnnotation is added.
      addAfter - Where to add the annotation 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.
      quadList - A list of quads to underline. Each quad encompasses a word or group of contiguous words in the text underlying the annotation.
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class TextMarkupAnnotation
    • generateAppearance

      public Form 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:
      generateAppearance in class Annotation