PSPDFTextMarkupAnnotation


@interface PSPDFTextMarkupAnnotation : 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 markup annotation from glyphs.

    Note

    This method should be called on a subclass, and not on this class directly.

    Declaration

    Objective-C

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

    Swift

    class func textOverlayAnnotation(with glyphs: [PSPDFGlyph]?) -> Self?

    Parameters

    glyphs

    The glyphs from which the markup annotation is to be created. It should have at least one object, otherwise nil is returned.

  • Convenience initializer that creates a text annotation from an array of rects to be marked up.

    Note

    This method should be called on a subclass, and not on this class directly.

    Declaration

    Objective-C

    + (nullable instancetype)textOverlayAnnotationWithRects:
                                 (nonnull NSArray<NSValue *> *)rects
                                                boundingBox:(CGRect)boundingBox
                                                  pageIndex:(NSUInteger)pageIndex;

    Swift

    class func textOverlayAnnotation(withRects rects: [NSValue], boundingBox: CGRect, pageIndex: UInt) -> Self?

    Parameters

    rects

    The rects, in PDF coordinates, that are to be marked up. Must have at least 1 rect, failing which nil is returned.

    boundingBox

    The bounding box for the annotation.

    pageIndex

    The page index the new annotation is on.

    Return Value

    An instance of the markup annotation.

  • Helper that will query the associated PSPDFDocument to get the marked up content. (Because we actually just write rects, it’s not easy to get the underlying text)

    Declaration

    Objective-C

    @property (readonly, atomic) NSString *_Nonnull markedUpString;

    Swift

    var markedUpString: String { get }