Class LineAnnotation

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

public class LineAnnotation extends Annotation
The line annotation displays a single straight line on a PDF page. When opened it displays a pop-up window containing the text of an associated note, placed at specific x/y coordinates for starting and ending points of the line.
  • Constructor Details

    • LineAnnotation

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

      public LineAnnotation(Page page, Rect initialRect, Point startPoint, Point endPoint, int addAfter)
      Create a new LineAnnotation 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.
      startPoint - The starting coordinate of the line, in user space.
      endPoint - The ending coordinate of the line, in user space.
      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
    • getStartPoint

      public Point getStartPoint()
      The starting coordinate of the line, in user space.

      If the line has leader lines, the start point represents the starting point of the leader line rather than the line itself.

    • setStartPoint

      public void setStartPoint(Point startPoint)
      The starting coordinate of the line, in user space.

      If the line has leader lines, the start point represents the starting point of the leader line rather than the line itself.

    • getEndPoint

      public Point getEndPoint()
      The ending coordinate of the line, in user space.

      If the line has leader lines, the end point represents the ending point of the leader line rather than the line itself.

    • setEndPoint

      public void setEndPoint(Point endPoint)
      The ending coordinate of the line, in user space.

      If the line has leader lines, the end point represents the ending point of the leader line rather than the line itself.

    • getStartPointEndingStyle

      public LineEndingStyle getStartPointEndingStyle()
    • setStartPointEndingStyle

      public void setStartPointEndingStyle(LineEndingStyle style)
    • getEndPointEndingStyle

      public LineEndingStyle getEndPointEndingStyle()
    • setEndPointEndingStyle

      public void setEndPointEndingStyle(LineEndingStyle style)
    • 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)