PTPDFAnnotationState


@interface PTPDFAnnotationState : NSObject

A representation of an annotation’s state.

  • Initializes a PTPDFAnnotationState instance.

    @returns An initialized PTPDFAnnotationState instance.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Creates and configures a new PTPDFAnnotationState (subclass) instance for the given annotation.

    Note

    In Swift, this method is imported as a throwing function.

    Declaration

    Objective-C

    + (nullable instancetype)stateForAnnotation:(nonnull PTAnnot *)annotation
                                      withError:(out NSError *_Nullable *_Nullable)
                                                    outError;

    Swift

    convenience init(forAnnotation annotation: PTAnnot) throws

    Parameters

    annotation

    The PDF annotation.

    outError

    On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

    Return Value

    A configured PTPDFAnnotationState instance, or nil if an error occurred.

  • The location of the annotation, in PDF page coordinates.

    This property represents the annotation’s bounding box, ie. the smallest upright rectangle that encompasses its appearance.

    @note The value of this property is defined in the coordinate space of the annotation’s containing PDF page.

    Declaration

    Objective-C

    @property (nonatomic) CGRect rect;

    Swift

    var rect: CGRect { get set }
  • The rotation of the annotation, in radians, counterclockwise relative to the page.

    The annotation appearance’s coordinate space is rotated by the angle specified by this property.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat rotation;

    Swift

    var rotation: CGFloat { get set }
  • The bounds of the annotation, in the annotation appearance’s coordinates.

    This rect is definied in the coordinate space of the annotation’s appearance.

    Declaration

    Objective-C

    @property (nonatomic) CGRect bounds;

    Swift

    var bounds: CGRect { get set }
  • The (plain) text contents of the annotation.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *contents;

    Swift

    var contents: String? { get set }
  • Declaration

    Objective-C

    - (BOOL)configureWithAnnotation:(nonnull PTAnnot *)annotation
                              error:(out NSError *_Nullable *_Nullable)outError;

    Swift

    func configure(withAnnotation annotation: PTAnnot) throws

    Parameters

    annotation

    The PDF annotation.