Class PDFAnnotation

java.lang.Object
org.openpdf.renderer.annotation.PDFAnnotation
Direct Known Subclasses:
LinkAnnotation, MarkupAnnotation, WidgetAnnotation

public class PDFAnnotation extends Object
Encapsulate a PDF annotation. This is only the super-class of PDF annotations, which has an "unknown" annotation type. Use the createAnnotation() method for getting an annotation of the correct type (if implemented).
Since:
03.07.2009
  • Field Details

  • Constructor Details

    • PDFAnnotation

      public PDFAnnotation(PDFObject annotObject) throws IOException
      Constructor
      Parameters:
      annotObject - - the PDFObject which contains the annotation description
      Throws:
      IOException
    • PDFAnnotation

      public PDFAnnotation(PDFObject annotObject, AnnotationType type) throws IOException
      Constructor
      Parameters:
      annotObject - - the PDFObject which contains the annotation description
      Throws:
      IOException
  • Method Details

    • createAnnotation

      public static PDFAnnotation createAnnotation(PDFObject parent) throws IOException
      Create a new PDF annotation object. Currently supported annotation types:
    • Link annotation
    • Parameters:
      parent -
      Returns:
      PDFAnnotation
      Throws:
      IOException
    • parseRect

      public Rectangle2D.Float parseRect(PDFObject obj) throws IOException
      Get a Rectangle2D.Float representation for a PDFObject that is an array of four Numbers.
      Parameters:
      obj - a PDFObject that represents an Array of exactly four Numbers.
      Throws:
      IOException
    • getPdfObj

      public PDFObject getPdfObj()
      Get the PDF Object which contains the annotation values
      Returns:
      PDFObject
    • getType

      public AnnotationType getType()
      Get the annotation type
      Returns:
      int
    • getRect

      public Rectangle2D.Float getRect()
      Get the rectangle on which the annotation should be applied to
      Returns:
      Rectangle2D.Float
    • getSubType

      public String getSubType()
    • getAnnotationName

      public String getAnnotationName()
    • getAppearanceState

      public String getAppearanceState()
    • getContents

      public String getContents()
    • getFlags

      public Integer getFlags()
    • isFlagSet

      public boolean isFlagSet(PDFAnnotation.Flags flag)
    • getModified

      public String getModified()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPageCommandsForAnnotation

      public List<PDFCmd> getPageCommandsForAnnotation()
      Get list of pdf commands for this annotation
      Returns:
    • getScalingTransformation

      protected AffineTransform getScalingTransformation(Rectangle2D.Float bbox)