Class SquareAnnotation

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

public class SquareAnnotation extends Annotation
The square annotation allows a user to display a rectangle on a PDF page. Text associated with the Square Annotation appears in a pop-up window. The size and shape of the rectangle is defined within the Rect entry.

  • Constructor Details

    • SquareAnnotation

      public SquareAnnotation(Page page, Rect initialRect)
      Create a new SquareAnnotation at the end of a page's annotation array. To create a SquareAnnotation 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 SquareAnnotation is added.
      initialRect - A rectangle specifying the annotation's bounds, specified in user space coordinates.
    • SquareAnnotation

      public SquareAnnotation(Page page, Rect initialRect, int addAfter)
      Create a new SquareAnnotation 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.
      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
    • 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
    • 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
    • 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)