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

    As with all annotation properties, post a .PSPDFAnnotationChanged notification to propagate changes.

    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) UIImage *_Nonnull renderAnnotationIcon;

    Swift

    var renderAnnotationIcon: UIImage { get }
  • Whether the renderAnnotationIcon should be rendered as is — defaults to false.

    When true, the icon is rendered without any changes. When false, the icon is used as a mask image for a gradient tinted in the receiver’s color.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL shouldDrawIconAsIs;

    Swift

    var shouldDrawIconAsIs: Bool { 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 }