PSPDFMarkupAnnotation


@interface PSPDFMarkupAnnotation : PSPDFAnnotation

Base class for Highlight, Underline, StrikeOut and Squiggly annotations. You should never create instances of this class directly. Use one of its subclasses instead.

  • Convenience initializer that creates a text annotation from glyphs. glyphs requires to have at least one object, otherwise nil is returned. pageRotation is the rotation property of the PSPDFPageInfo

    Declaration

    Objective-C

    + (nullable instancetype)
    textOverlayAnnotationWithGlyphs:(nullable NSArray<PSPDFGlyph *> *)glyphs
                       pageRotation:(NSInteger)pageRotation;

    Swift

    class func textOverlayAnnotation(with glyphs: [PSPDFGlyph]?, pageRotation: Int) -> Self?
  • Helper that will query the associated PSPDFDocument to get the highlighted content. (Because we actually just write rects, it’s not easy to get the underlying text)

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull highlightedString;

    Swift

    var highlightedString: String { get }