Class FreeTextAnnotation

java.lang.Object
com.datalogics.PDFL.Annotation
com.datalogics.PDFL.FreeTextAnnotation

public class FreeTextAnnotation extends Annotation
The free text annotation allows a user to place text directly on a PDF page. An ordinary text annotation appears in a pop up window, and is attached to an icon; it represents a note added to a PDF file, and can be opened for viewing, or closed. But a free text annotation always appears open on the page. A free text annotation can be included anywhere in a PDF file by specifying the location and the CallOutLine points.
  • Constructor Details

    • FreeTextAnnotation

      public FreeTextAnnotation(Page page, Rect initialRect, String defaultAppearance)
      Create a new FreeTextAnnotation 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 FreeTextAnnotation is added.
      initialRect - A rectangle specifying the annotation's bounds, specified in user space coordinates.
      defaultAppearance - The default appearance string to be used in formatting the text.
    • FreeTextAnnotation

      public FreeTextAnnotation(Page page, Rect initialRect, String defaultAppearance, int addAfter)
      Create a new FreeTextAnnotation at a specific index in the page's annotation array.

      Parameters:
      page - The page to which the annotation is added.
      initialRect - A rectangle specifying the annotation's bounds, specified in user space coordinates.
      defaultAppearance - The default appearance string to be used in formatting the text.
      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.
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class Annotation
    • getDefaultAppearance

      public String getDefaultAppearance()
      The default appearance string to be used in formatting the text.
    • setDefaultAppearance

      public void setDefaultAppearance(String arg0)
      The default appearance string to be used in formatting the text.
    • getQuadding

      public HorizontalAlignment getQuadding()
      A code specifiying the form of quadding (justification) to be used in displaying the annotation's text.
    • setQuadding

      public void setQuadding(HorizontalAlignment quadding)
      A code specifiying the form of quadding (justification) to be used in displaying the annotation's text.
    • getAnnotationFeatureLevel

      public double getAnnotationFeatureLevel()
      The minimum PDF version necessary to support the features used in this annotation.
      Overrides:
      getAnnotationFeatureLevel in class Annotation
    • setAnnotationFeatureLevel

      public void setAnnotationFeatureLevel(double featureLevel)
      Removes features not supported in the supplied version number.
      Overrides:
      setAnnotationFeatureLevel in class Annotation
    • 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
    • setFontSize

      public void setFontSize(double fontSize)
      Set font size for text
    • getFontSize

      public double getFontSize()
      Get font size for the text;

      Returns:
      current font size
    • setFontFace

      public void setFontFace(String fontName)
      Set Font face for the text
    • getFontFace

      public String getFontFace()
      Get Font face for the text

      Returns:
      current Font face
    • getColor

      @Deprecated public Color getColor()
      Deprecated.
      (Deprecated, function may be removed in future, use GetInteriorColor instead) The color of the annotation. This method the same to the GetInteriorColor method.

      Overrides:
      getColor in class Annotation
    • setColor

      @Deprecated public void setColor(Color arg0)
      Deprecated.
      (Deprecated, function may be removed in future, use SetInteriorColor instead) The color of the annotation. This method the same to the SetInteriorColor method.

      Overrides:
      setColor in class Annotation
    • getTextColor

      public Color getTextColor()
      The text color which used for drawing text

      Returns:
      color Freetext Annotation's text
    • setTextColor

      public void setTextColor(Color textColor)
      • The text color which used for drawing text

    • getBorderStyleWidth

      public double getBorderStyleWidth()
    • setBorderStyleWidth

      public void setBorderStyleWidth(double width)
    • getBorderStyle

      public String getBorderStyle()
    • setBorderStyle

      public void setBorderStyle(String style)
    • getBorderStyleDashPattern

      public List<Double> getBorderStyleDashPattern()
    • setBorderStyleDashPattern

      public void setBorderStyleDashPattern(List<Double> dashPattern)