PTTextExtractorLine

@interface PTTextExtractorLine : NSObject

TextExtractor::Line object represents a line of text on a PDF page. Each line consists of a sequence of words, and each words in one or more styles.

  • Declaration

    Objective-C

    - (int)GetNumWords;

    Swift

    func getNumWords() -> Int32

    Return Value

    The number of words in this line.

  • Declaration

    Objective-C

    - (BOOL)IsSimpleLine;

    Swift

    func isSimpleLine() -> Bool

    Return Value

    true is this line is not rotated (i.e. if the quadrilaterals returned by GetBBox() and GetQuad() coincide).

  • 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 line (in unrotated page coordinates).

  • Declaration

    Objective-C

    - (NSMutableArray *)GetQuad;

    Swift

    func getQuad() -> NSMutableArray!

    Return Value

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

  • Note

    To traverse the list of all words on this line use word.GetNextWord().

    Declaration

    Objective-C

    - (PTWord *)GetFirstWord;

    Swift

    func getFirstWord() -> PTWord!

    Return Value

    the first word in the line.

  • Declaration

    Objective-C

    - (PTWord *)GetWord:(int)word_idx;

    Swift

    func getWord(_ word_idx: Int32) -> PTWord!

    Parameters

    word_idx

    A integer representing the index of the word to get.

    Return Value

    the i-th word in this line.

  • Declaration

    Objective-C

    - (PTTextExtractorLine *)GetNextLine;

    Swift

    func getNext() -> PTTextExtractorLine!

    Return Value

    the next line on the page.

  • Declaration

    Objective-C

    - (int)GetCurrentNum;

    Swift

    func getCurrentNum() -> Int32

    Return Value

    the index of this line of the current page.

  • Declaration

    Objective-C

    - (PTTextExtractorStyle *)GetStyle;

    Swift

    func getStyle() -> PTTextExtractorStyle!

    Return Value

    predominant style for this line.

  • Declaration

    Objective-C

    - (int)GetParagraphID;

    Swift

    func getParagraphID() -> Int32

    Return Value

    The unique identifier for a paragraph or column that this line belongs to. This information can be used to identify which lines belong to which paragraphs.

  • Declaration

    Objective-C

    - (int)GetFlowID;

    Swift

    func getFlowID() -> Int32

    Return Value

    The unique identifier for a paragraph or column that this line belongs to. This information can be used to identify which lines/paragraphs belong to which flows.

  • Declaration

    Objective-C

    - (BOOL)EndsWithHyphen;

    Swift

    func endsWithHyphen() -> Bool

    Return Value

    true is this line of text ends with a hyphen (i.e. ‘-’), false otherwise.

  • Declaration

    Objective-C

    - (BOOL)IsValid;

    Swift

    func isValid() -> Bool

    Return Value

    true if this is a valid line, false otherwise.

  • Undocumented

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()