react-pdf-highlighter
react-pdf-highlighter copied to clipboard
Trouble implementing PDFFindController from PDFJS
Hey guys,
I am currently using the react-pdf-highlighter package and I would like to add a search functionality throughout the PDF documents, however I am really having a hard time trying to implement the pdfFindController from pdfjs, I saw someone else managed to get it working with this package, could anyone please tell me how to implement this?
I am trying to add a new pdfFindController to an already existing pdfViewer instance using the eventBus and linkService i get from window.PDFViewer that is created by react-pdf-highlighter but no success. Any help would be appreciated!
Thanks!
Hi @RutgerSwirski
You can use following code in init() function:
this.viewer.findController= new PDFFindController({ eventBus: this.eventBus, linkService: this.linkService, });
See discussion in https://github.com/agentcooper/react-pdf-highlighter/issues/176 for adding this to API.