PSPDFNoteAnnotation


@interface PSPDFNoteAnnotation : PSPDFAnnotation

PDF Note (Text) Annotation. - note: Note annotations are rendered as fixed size; much like how Adobe Acrobat renders them. PSPDFKit will always render note annotations at a fixed size of 32x32pt. We recommend that you set the boundingBox to the same value.

  • Initialize with text contents.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithContents:(nonnull NSString *)contents;

    Swift

    init(contents: String)
  • Note Icon name (see PSPDFKit.bundle for available icon names) If set to nil, it will return to the default Comment.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, null_resettable) NSString *iconName;

    Swift

    var iconName: String! { get set }
  • Image that is rendered.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) UIImage *renderAnnotationIcon;

    Swift

    var renderAnnotationIcon: UIImage? { get }
  • Called to render the note image.

    Declaration

    Objective-C

    - (void)drawImageInContext:(nonnull CGContextRef)context
                   boundingBox:(CGRect)boundingBox
                       options:(nullable NSDictionary<NSString *, id> *)options;

    Swift

    func drawImage(in context: CGContext, boundingBox: CGRect, options: [String : Any]? = nil)
  • If the note annotation is rendered as text, this method returns the bounding box to contain the text. This is used for flattening a note annotation.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGRect boundingBoxIfRenderedAsText;

    Swift

    var boundingBoxIfRenderedAsText: CGRect { get }