mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.25k stars 9.96k forks source link

Search and highlight programmatically without displaying toolbar #6307

Closed rahulpandya closed 9 years ago

rahulpandya commented 9 years ago

Is there a way to implement the search and highlight functionality programmatically? Ideally, we render the page without displaying the toolbar and can use javascript to pass in a piece of text/phrase and highlight all occurrences. I see the search code in PDFFindController. I'm just not quite sure how to trigger it. I've also been trying to add code to examples/components/pageviewer.js because this was an established example without the toolbar, but it uses the PDFPageView object and I'm not sure if that's an issue at all.

timvandermeij commented 9 years ago

This request is already tracked in #1875. To work without the toolbar you should indeed use the components example.

yurydelendik commented 8 years ago

PDFFindController now does not require find bar to function, see also https://github.com/mozilla/pdf.js/blob/master/examples/components/simpleviewer.js#L57