PSPDFAbstractLineAnnotation


@interface PSPDFAbstractLineAnnotation : PSPDFAbstractShapeAnnotation

Base class for Line, Polygon and PolyLine annotations.

  • Designated initializer. Requires an array with at least two points.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPoints:
        (nonnull NSArray<__kindof NSValue *> *)points;

    Swift

    init(points: [NSValue])
  • Starting line end type.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) PSPDFLineEndType lineEnd1;

    Swift

    var lineEnd1: PSPDFLineEndType { get set }
  • Ending line end type.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) PSPDFLineEndType lineEnd2;

    Swift

    var lineEnd2: PSPDFLineEndType { get set }
  • The path of the line. Might return nil if there are not sufficient points defined in the annotation. If you override this property, take care to create the path with the annotation’s lineDashStyle

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) UIBezierPath *bezierPath;

    Swift

    @NSCopying var bezierPath: NSBezierPath? { get }
  • By default, setting the boundingBox will transform the annotation. Use this setter to manually change the boundingBox without changing the points.

    Declaration

    Objective-C

    - (void)setBoundingBox:(CGRect)boundingBox
           transformPoints:(BOOL)transformPoints;

    Swift

    func setBoundingBox(_ boundingBox: CGRect, transformPoints: Bool)
  • Call after points have been changed to update the bounding box.

    Declaration

    Objective-C

    - (void)recalculateBoundingBox;

    Swift

    func recalculateBoundingBox()