readium-js-viewer icon indicating copy to clipboard operation
readium-js-viewer copied to clipboard

Find all the cfis of a text / word / words provided by the user in epub

Open rudra0713 opened this issue 6 years ago • 0 comments

I have created a search box where user can type a text he wishes to find. I want to find all the cfis for that text in my epub document. I already tried this - readium.reader.on("renderer:selected", function(range) { console.log("inside renderer:selected"); var epubcfi = new EPUBJS.EpubCFI(); var cfi = epubcfi.generateCfiFromRangeAnchor(range,book.renderer.currentChapter.cfiBase); console.log("selected:", cfi ); }); I thought this would work when user selects any text in the epub. But this does not work. I searched and found a epub search engine completed by lars vogit. https://github.com/larsvoigt/epub-full-text-search It returns all the cfis when a search query is made with the intended word which is what I need right now. But this is not a readium project and commands like import or require does not seem to work in readium
so I had no way to incorporate this in my project.

rudra0713 avatar Aug 14 '17 15:08 rudra0713