PSPDFAnnotationSet

Objective-C


@interface PSPDFAnnotationSet : PSPDFModel <NSFastEnumeration, NSSecureCoding>

Swift

class AnnotationSet : ModelObject, NSFastEnumeration, NSSecureCoding

An annotation set may be used to add and position multiple annotations.

  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Not the designated initializer

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnotations:
                                (nonnull NSArray<__kindof PSPDFAnnotation *> *)
                                    annotations
                                copyAnnotations:(BOOL)shouldCopyAnnotations;

    Swift

    init(annotations: [PSPDFAnnotation], copyAnnotations shouldCopyAnnotations: Bool)

    Parameters

    annotations

    The annotations the set holds.

    shouldCopyAnnotations

    If true, a deep copy of the annotations will be made and the annotation bounding boxes will be normalized so the bottom-left one will have its origin at (0,0).

  • The saved annotations.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<__kindof PSPDFAnnotation *> *_Nonnull annotations;

    Swift

    var annotations: [PSPDFAnnotation] { get }
  • Draw all annotations.

    Declaration

    Objective-C

    - (void)drawInContext:(nonnull CGContextRef)context
                  options:(nullable PSPDFRenderOptions *)options;

    Swift

    func draw(in context: CGContext, options: PSPDFRenderOptions?)
  • Bounding box of all annotations. If set, will correctly resize all annotations.

    Declaration

    Objective-C

    @property (nonatomic) CGRect boundingBox;

    Swift

    var boundingBox: CGRect { get set }
  • Copies the current set to the clipboard.

    Declaration

    Objective-C

    - (void)copyToClipboard;

    Swift

    func copyToClipboard()
  • Loads a PSPDFAnnotationSet from the clipboard.

    Note

    Also supports legacy format and will automatically pack it into a PSPDFAnnotationSet.

    Declaration

    Objective-C

    + (nullable instancetype)unarchiveFromClipboard;

    Swift

    class func unarchiveFromClipboard() -> Self?
  • Deprecated

    Deprecated in PSPDFKit 4.2 for macOS. Please use initWithAnnotations:copyAnnotations:, with copyAnnotations as true.

    annotations will be a deep copy of the current annotations. The boundingBox of the annotations will be normalized. (upper left one will have 0,0 origin)

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnotations:
        (nonnull NSArray<__kindof PSPDFAnnotation *> *)annotations;

    Swift

    convenience init(annotations: [PSPDFAnnotation])

    Parameters

    annotations

    The annotations to copy into the new annotation set.