# Configuration:
- Web browser and its version: Chrome
- Operating system and its version: MacOS
- PDF.js version: 2.6.347
- Is a browser extension: No

# Steps to reproduce the problem:
1. Implement FindBar, including Find next / Find prev buttons

# What is the expected behavior? (add screenshot)

This might be intentional but seems a bit off. The PDFFindBar findPreviousButton / findNextButton should raise an event with options that can be passed directly to PDFindController.executeCommand

What went wrong? (add screenshot)

PDFBar raises an event on the EventBus which looks like this;

`this.eventBus.dispatch("find", { query: "hello",  ... type: "again" .... });`

https://github.com/mozilla/pdf.js/blob/00b4f86db301546d21d5dc79c61e2a9a829667a4/web/pdf_find_bar.js#L93-L105
[](url)
PDFFindController expects;

`pdfFindController.executeCommand("findagain", { query: "hello" });`

Which means you can't just pass the options through because the cmd doesn't match. Is there a reason PDFFindController doesn't just accept the following?

`pdfFindController.executeCommand("find", { query: "hello", type: "again" });`

Seems like it should work this way?

Thanks

;
    }
    if (!caseSensitive) {
      pageContent = pageContent.toLowerCase();
      query = query.toLowerCase();
    }
    if (phraseSearch) {
      this._calculatePhraseMatch(
        query,
        pageIndex,
        pageContent,
        pageDiffs,
        entireWord
      );
    } else {
      this._calculateWordMatch(
        query,
        pageIndex,
        pageContent,
        pageDiffs,
        entireWord
      );
    }
    
    
    if (this._state.highlightAll) {
      this._updatePage(pageIndex);
    }
    if (this._resumePageIdx === pageIndex) {
      this._resumePageIdx = null;
      this._nextPageMatch();
    }
    
    const pageMatchesCount = this._pageMatches[pageIndex].length;
    if (pageMatchesCount > 0) {
      this._matchesCountTotal += pageMatchesCount;
      this._updateUIResultsCount();
    }
  }
  _extractText() {
    
    if (this._extractTextPromises.length > 0) {
      return;
    }
    let promise = Promise.resolve();
    for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
      const extractTextCapability = createPromiseCapability();
      this._extractTextPromises[i] = extractTextCapability.promise;
      promise = promise.then(() => {
        return this._pdfDocument
          .getPage(i + 1)
          .then(pdfPage => {
            return pdfPage.getTextContent({
              normalizeWhitespace: true,
            });
          })
          .then(
            textContent => {
              const textItems = textContent.items;
              const strBuf = [];
              for (let j = 0, jj = textItems.length; j < jj; j++) {
                strBuf.push(textItems[j].str);
              }
              
              [this._pageContents[i], this._pageDiffs[i]] = normalize(
                strBuf.join("")
              );
              extractTextCapability.resolve(i);
            },
            reason => {
              console.error(
                `Unable to get text content for page ${i + 1}`,
                rea