react-pdf-highlighter icon indicating copy to clipboard operation
react-pdf-highlighter copied to clipboard

Trouble implementing PDFFindController from PDFJS

Open RutgerSwirski opened this issue 3 years ago • 2 comments

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!

RutgerSwirski avatar Dec 07 '21 10:12 RutgerSwirski

Hi @RutgerSwirski

You can use following code in init() function:

this.viewer.findController= new PDFFindController({ eventBus: this.eventBus, linkService: this.linkService, });

dalbir avatar Jan 22 '22 09:01 dalbir

See discussion in https://github.com/agentcooper/react-pdf-highlighter/issues/176 for adding this to API.

holub008 avatar Apr 07 '22 22:04 holub008