Implements

Constructors

  • Creates an instance of TextPage. Instead of creating an instance in new mode, use create to create an instance.

    Parameters

    • options: Options

      Create a TextPage instance with the specified options.

      let textPage = await TextPage.create({
      page,
      flag: 0,
      });

    Returns TextPage

Properties

options: Options

Methods

  • Destroy the TextPage object.

    Returns Promise<void>

  • Get the rectangle array for character index interzone.

    Parameters

    • start: number

      The start character index.

    • count: number

      The count of characters.

    Returns Promise<null | FloatRectArrayType>

    let textPage = await TextPage.create({
    page,
    flag: 0
    });
    await textPage.parseTextPage();
    let pageTextSearch = await textPage.createPageTextSearch();
    let bFind = await pageTextSearch.findFirst("search text", 0, 0);
    if (bFind) {
    let floatRectArray = await textPage.getRectArray(0, 10);
    }
  • Get the text by rect.

    Parameters

    • rect: Rect

      The rect object.

    Returns Promise<string>

    Returns the text.

  • Check whether the text page has been parsed.

    Returns Promise<boolean>

    True means has been parsed, otherwise false.

    let bRet = await textPage.isParsed();
    
  • The page object may have parsed content objects.

    Returns Promise<boolean>

    True if the parsing is successful, otherwise false.

    let textPage = await TextPage.create({
    page,
    flag: 0
    });
    let bRet = await textPage.parseTextPage();
  • Create a TextPage instance with the specified options.

    Parameters

    • options: Options

      Create a TextPage instance with the specified options.

    Returns Promise<TextPageType>

    Returns a TextPage instance.

    let textPage = await TextPage.create({
    page,
    flag: 0,
    });