npm ng2-pdf-viewer 4.1.1

latest releases: 10.3.0, 10.2.2, 10.2.1...
6 years ago

Features

  • [#260] - Public PDFFindController
  • [#279] - make pdfFindController public

pdfFindController is now public, that means you can now execute a search on the pdf.

In your component's ts file:

  • Add reference to pdf-viewer,
  • then when needed execute search()
@ViewChild(PdfViewerComponent) private pdfComponent: PdfViewerComponent;

search(stringToSearch: string) {
  this.pdfComponent.pdfFindController.executeCommand('find', {
    caseSensitive: false, findPrevious: undefined, highlightAll: true, phraseSearch: true, query: stringToSearch
  });
}

Don't miss a new ng2-pdf-viewer release

NewReleases is sending notifications on new releases.