since version 21.3.0
before version 21.3.0
This is a very advanced usecase.
If you want to implement your own find algorithm, define a class implementing the find controller and pass it to the attribute pdfDefaultOptions.findController
before opening the PDF file.
To get started, copy the files pdf_find_controller.js
, ui_utils.js
, and pdf_find_utils.js
from the source code of this showcase to your project and extend your own find controller from the class PDFFindController
.
The live demo below doesn't do much. It only prints console messages when the custom find controller is instantiated and when the find algorithm is called.
HTML template
TypeScript
TypeScript
<ngx-extended-pdf-viewer
src="/assets/pdfs/Portugues-para-principiantes-1538054164.pdf"
[textLayer]="true"
[showFindButton]="false"
(updateFindMatchesCount)="onUpdateFindMatchesCount($event)"
(pdfLoaded)="pdfLoaded()">
</ngx-extended-pdf-viewer>