Class PDAnnotationText

All Implemented Interfaces:
COSObjectable

public class PDAnnotationText extends PDAnnotationMarkup
This is the class that represents a text annotation.
  • Field Details

  • Constructor Details

    • PDAnnotationText

      public PDAnnotationText()
      Constructor.
    • PDAnnotationText

      public PDAnnotationText(COSDictionary field)
      Creates a Text annotation from a COSDictionary, expected to be a correct object definition.
      Parameters:
      field - the PDF object to represent as a field.
  • Method Details

    • setOpen

      public void setOpen(boolean open)
      This will set initial state of the annotation, open or closed.
      Parameters:
      open - Boolean value, true = open false = closed
    • getOpen

      public boolean getOpen()
      This will retrieve the initial state of the annotation, open Or closed (default closed).
      Returns:
      The initial state, true = open false = closed
    • setName

      public void setName(String name)
      This will set the name (and hence appearance, AP taking precedence) For this annotation. See the NAME_XXX constants for valid values.
      Parameters:
      name - The name of the annotation
    • getName

      public String getName()
      This will retrieve the name (and hence appearance, AP taking precedence) For this annotation. The default is NOTE.
      Returns:
      The name of this annotation, see the NAME_XXX constants.
    • getState

      public String getState()
      This will retrieve the annotation state.
      Returns:
      the annotation state
    • setState

      public void setState(String state)
      This will set the annotation state.
      Parameters:
      state - the annotation state
    • getStateModel

      public String getStateModel()
      This will retrieve the annotation state model.
      Returns:
      the annotation state model
    • setStateModel

      public void setStateModel(String stateModel)
      This will set the annotation state model. Allowed values are "Marked" and "Review"
      Parameters:
      stateModel - the annotation state model
    • setCustomAppearanceHandler

      public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)
      Set a custom appearance handler for generating the annotations appearance streams.
      Overrides:
      setCustomAppearanceHandler in class PDAnnotationMarkup
      Parameters:
      appearanceHandler -
    • constructAppearances

      public void constructAppearances()
      Description copied from class: PDAnnotation
      Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.
      Overrides:
      constructAppearances in class PDAnnotationMarkup
    • constructAppearances

      public void constructAppearances(PDDocument document)
      Description copied from class: PDAnnotation
      Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.
      Overrides:
      constructAppearances in class PDAnnotationMarkup