pdfjs/web/viewer.js
function PDFFindController_updateMatchPosition(pageIndex, index, elements, beginIdx) {
            if (this.selected.matchIdx === index && this.selected.pageIdx === pageIndex) {
              var spot = {
                top: FIND_SCROLL_OFFSET_TOP,
                left: FIND_SCROLL_OFFSET_LEFT
              };
              scrollIntoView(elements[beginIdx], spot, /* skipOverflowHiddenElements = */
              true);
            }
          }
function PDFFindController_updateMatchPosition(pageIndex, index, elements, beginIdx) {
            if (this.selected.matchIdx === index && this.selected.pageIdx === pageIndex) {
              var spot = {
                top: FIND_SCROLL_OFFSET_TOP,
                left: FIND_SCROLL_OFFSET_LEFT
              };
              scrollIntoView(elements[beginIdx], spot, /* skipOverflowHiddenElements = */
              true);
            }
          }
function PDFFindController_updateMatchPosition ( pageIndex , index , elements , beginIdx ) { if ( this . selected . matchIdx === index && this . selected . pageIdx === pageIndex ) { var spot = { top : FIND_SCROLL_OFFSET_TOP , left : FIND_SCROLL_OFFSET_LEFT } ; scrollIntoView ( elements [ beginIdx ] , spot , /* skipOverflowHiddenElements = */ true ) ; } }
The method is called back from the text layer when match presentation
is updated.
@param {number} pageIndex - page index.
@param {number} index - match index.
@param {Array} elements - text layer div elements array.
@param {number} beginIdx - start index of the div array for the match.
The method is called back from the text layer when match presentation is updated .