PSPDFAnnotationSet

Objective-C


@interface PSPDFAnnotationSet : PSPDFModel <NSFastEnumeration>

Swift

class AnnotationSet : ModelObject, NSFastEnumeration

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<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<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.

    For subclasses of AnnotationSet, this will still copy an AnnotationSet, not an instance of the subclass, because subclasses may have additional initialization requirements.

    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?