PSPDFTextParser


@interface PSPDFTextParser : NSObject

Parses the text and glyph data of a single PDF page. - note: Don’t instantiate this class directly, but get an instance from PSPDFDocumentProvider Properties are evaluated lazily and then cached.

  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFTextParser : NSObject
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFTextParser : NSObject
  • The complete page text, including extrapolated spaces and newline characters.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull text;

    Swift

    var text: String { get }
  • Complete list of PSPDFGlyph objects. Corresponds to the text.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSArray<PSPDFGlyph *> *_Nonnull glyphs;

    Swift

    var glyphs: [PSPDFGlyph] { get }
  • List of detected words.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSArray<PSPDFWord *> *_Nonnull words;

    Swift

    var words: [PSPDFWord] { get }
  • List of detected text blocks.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<PSPDFTextBlock *> *_Nonnull textBlocks;

    Swift

    var textBlocks: [PSPDFTextBlock] { get }
  • List of detected images.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSArray<PSPDFImageInfo *> *_Nonnull images;

    Swift

    var images: [PSPDFImageInfo] { get }
  • Associated document provider.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        PSPDFDocumentProvider *_Nullable documentProvider;

    Swift

    weak var documentProvider: PSPDFDocumentProvider? { get }
  • Page relative to the documentProvider.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSUInteger pageIndex;

    Swift

    var pageIndex: UInt { get }
  • Uses glyphs to return the corresponding page text, including newlines and spaces.

    Declaration

    Objective-C

    - (nonnull NSString *)textWithGlyphs:(nonnull NSArray<PSPDFGlyph *> *)glyphs;

    Swift

    func text(with glyphs: [PSPDFGlyph]) -> String
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFTextParser : NSObject