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 }
  • The category of the author-specific state associated with the parent annotation.

    As in the PDF specification, the state is not specified on the annotation itself but on a separate note annotation that refers to the original annotation by means of the inReplyToAnnotation.

    The default is PSPDFAnnotationAuthorStateModelUnspecified.

    It is not possible to set this back to PSPDFAnnotationAuthorStateModelUnspecified.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        PSPDFAnnotationAuthorStateModel authorStateModel;

    Swift

    var authorStateModel: PSPDFAnnotationAuthorStateModel { get set }
  • The author-specific state associated with the parent annotation.

    As in the PDF specification, the state is not specified on the annotation itself but on a separate note annotation that refers to the original annotation by means of the inReplyToAnnotation.

    The default is PSPDFAnnotationAuthorStateUnspecified.

    It is not possible to set this back to PSPDFAnnotationAuthorStateUnspecified.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) PSPDFAnnotationAuthorState authorState;

    Swift

    var authorState: PSPDFAnnotationAuthorState { get set }
  • Image that is rendered.

    Declaration

    Objective-C

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

    Swift

    var renderAnnotationIcon: NSImage? { 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 }