PTWord

@interface PTWord : NSObject

TextExtractor::Word object represents a word on a PDF page. Each word contains a sequence of characters in one or more styles (see TextExtractor::Style).

  • Declaration

    Objective-C

    - (int)GetNumGlyphs;

    Swift

    func getNumGlyphs() -> Int32

    Return Value

    The number of glyphs in this word.

  • Note

    To account for the effect of page ‘/Rotate’ attribute, transform all points using page.GetDefaultMatrix().

    Declaration

    Objective-C

    - (PTPDFRect *)GetBBox;

    Swift

    func getBBox() -> PTPDFRect!

    Parameters

    out_bbox

    The bounding box for this word (in unrotated page coordinates).

  • Declaration

    Objective-C

    - (NSMutableArray *)GetQuad;

    Swift

    func getQuad() -> NSMutableArray!

    Parameters

    out_quad

    The quadrilateral representing a tight bounding box for this word (in unrotated page coordinates).

  • Declaration

    Objective-C

    - (NSMutableArray *)GetGlyphQuad:(int)glyph_idx;

    Swift

    func getGlyphQuad(_ glyph_idx: Int32) -> NSMutableArray!

    Parameters

    glyph_idx

    The index of a glyph in this word.

    out_quad

    The quadrilateral representing a tight bounding box for a given glyph in the word (in unrotated page coordinates).

  • Declaration

    Objective-C

    - (PTTextExtractorStyle *)GetCharStyle:(int)char_idx;

    Swift

    func getCharStyle(_ char_idx: Int32) -> PTTextExtractorStyle!

    Parameters

    char_idx

    The index of a character in this word.

    Return Value

    The style associated with a given character.

  • Declaration

    Objective-C

    - (PTTextExtractorStyle *)GetStyle;

    Swift

    func getStyle() -> PTTextExtractorStyle!

    Return Value

    predominant style for this word.

  • Declaration

    Objective-C

    - (int)GetStringLen;

    Swift

    func getStringLen() -> Int32

    Return Value

    the number of characters in this word.

  • Declaration

    Objective-C

    - (NSString *)GetString;

    Swift

    func getString() -> String!

    Return Value

    the content of this word represented as a Unicode string.

  • Declaration

    Objective-C

    - (PTWord *)GetNextWord;

    Swift

    func getNext() -> PTWord!

    Return Value

    the next word on the current line.

  • Declaration

    Objective-C

    - (int)GetCurrentNum;

    Swift

    func getCurrentNum() -> Int32

    Return Value

    the index of this word of the current line. A word that starts the line will return 0, whereas the last word in the line will return (line.GetNumWords()-1).

  • Declaration

    Objective-C

    - (BOOL)IsValid;

    Swift

    func isValid() -> Bool

    Return Value

    true if this is a valid word, false otherwise.

  • Undocumented

    Declaration

    Objective-C

    - (BOOL)isEqualTo: (PTWord*)arg0;

    Swift

    func isEqual(to arg0: PTWord!) -> Bool
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()