PSPDFSearchResult


@interface PSPDFSearchResult : PSPDFModel

Represents an immutable search result from PSPDFTextSearch.

  • Designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDocumentUID:(nonnull NSString *)documentUID
                                      pageIndex:(NSUInteger)pageIndex
                                          range:(NSRange)range
                                    previewText:(nonnull NSString *)previewText
                             rangeInPreviewText:(NSRange)rangeInPreviewText
                                      selection:(nullable PSPDFTextBlock *)selection
                                     annotation:
                                         (nullable PSPDFAnnotation *)annotation;

    Swift

    init(documentUID: String, pageIndex: UInt, range: NSRange, previewText: String, rangeInPreviewText: NSRange, selection: PSPDFTextBlock?, annotation: PSPDFAnnotation?)
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFSearchResult : PSPDFModel
  • Referenced page.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger pageIndex;

    Swift

    var pageIndex: UInt { get }
  • Preview text snippet.

    Declaration

    Objective-C

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

    Swift

    var previewText: String { get }
  • Range of the search result in relation to the previewText.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSRange rangeInPreviewText;

    Swift

    var rangeInPreviewText: NSRange { get }
  • Range within full page text.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSRange range;

    Swift

    var range: NSRange { get }
  • Text coordinates. Usually the text block contains only one word, unless the search is split across two lines. - note: This property is optional.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) PSPDFTextBlock *selection;

    Swift

    var selection: PSPDFTextBlock? { get }
  • If the search result references an annotation, the object is set. - note: This property is only set if the search result points to an annotation.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFAnnotation *_Nullable annotation;

    Swift

    weak var annotation: PSPDFAnnotation? { get }
  • The UID of the referenced document.

    Declaration

    Objective-C

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

    Swift

    var documentUID: String { get }
  • Referenced document.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFDocument *_Nullable document;

    Swift

    weak var document: PSPDFDocument? { get }