PSPDFNoteAnnotation

Objective-C


@interface PSPDFNoteAnnotation : PSPDFAnnotation <PSPDFOverridable>

Swift

class NoteAnnotation : Annotation, Overridable

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 that changes the image representation.

    PDF knows several standard icon names: Comment, RightPointer, RightArrow, Check, Circle, Cross, Insert, NewParagraph, Note, Paragraph, Help, Star, Key.

    Note

    If set to nil, it will return to the default “Comment”.

    Declaration

    Objective-C

    @property (copy, 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 PSPDFAnnotationAuthorStateModel authorStateModel;
  • 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 PSPDFAnnotationAuthorState authorState;
  • Image that is rendered.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSImage *_Nonnull 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 PSPDFRenderOptions *)options;

    Swift

    func drawImage(in context: CGContext, boundingBox: CGRect, options: PSPDFRenderOptions?)
  • 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) CGRect boundingBoxIfRenderedAsText;

    Swift

    var boundingBoxIfRenderedAsText: CGRect { get }
  • 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 unspecified.

    Note

    It is not possible to set this back to unspecified.

    Declaration

    Swift

    public var authorState: Annotation.State { get set }