Class PDAnnotationCaret

All Implemented Interfaces:
COSObjectable

public class PDAnnotationCaret extends PDAnnotationMarkup
  • Field Details

  • Constructor Details

    • PDAnnotationCaret

      public PDAnnotationCaret()
    • PDAnnotationCaret

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

    • setRectDifferences

      public void setRectDifferences(float difference)
      This will set the difference between the annotations "outer" rectangle defined by /Rect and boundaries of the underlying.

      This will set an equal difference for all sides

      Parameters:
      difference - from the annotations /Rect entry
    • setRectDifferences

      public void setRectDifferences(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom)
      This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.
      Parameters:
      differenceLeft - left difference from the annotations /Rect entry
      differenceTop - top difference from the annotations /Rect entry
      differenceRight - right difference from the annotations /Rect entry
      differenceBottom - bottom difference from the annotations /Rect entry
    • getRectDifferences

      public float[] getRectDifferences()
      This will get the margin between the annotations "outer" rectangle defined by /Rect and the boundaries of the underlying caret.
      Returns:
      the differences. If the entry hasn't been set am empty array is returned.
    • setCustomAppearanceHandler

      public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)
      Set a custom appearance handler for generating the annotations appearance streams.
      Parameters:
      appearanceHandler - custom appearance handler
    • 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 PDAnnotation
    • 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 PDAnnotation
      Parameters:
      document - the related document