Implements

Constructors

  • Create a PageTextSearch instance. Instead of creating an instance in new mode, use create to create an instance.

    Parameters

    • options: Options

      Create a PageTextSearch instance with the specified options.

    Returns PageTextSearch

    let doc = await app.getActiveDoc();
    let page = await doc.getPage(0);
    let textPage = await TextPage.create({
    page,
    flag: 0,
    });
    const pageTextSearch = await PageTextSearch.create({textPage: textPage});

Properties

options: Options

Methods

  • Find the next match of the text.

    Returns Promise<boolean>

    Return true if the text is found, otherwise return false.

    let textPage = await page.getTextPage();
    let pageTextSearch = await textPage.createPageTextSearch();
    let bFind = await pageTextSearch.findFirst('search text', 0, 0);
    while (bFind) {
    let rectArrayItem = await pageTextSearch.getRectArray();
    bFind = await pageTextSearch.findNext();
    }
  • Find the previous match of the text.

    Returns Promise<boolean>

    Return true if the text is found, otherwise return false.

  • Create a PageTextSearch instance.

    Parameters

    • options: Options

      Create a PageTextSearch instance with the specified options.

    Returns Promise<PageTextSearchType>

    Return a PageTextSearch instance.

    let doc = await app.getActiveDoc();
    let page = await doc.getPage(0);
    let textPage = await TextPage.create({
    page,
    flag: 0,
    });
    const pageTextSearch = await PageTextSearch.create({textPage: textPage});