0

How to highlight nth line. For example I want to highlight the 100th line of whole pdf, how can I achieve that. Another thing is that I want to highlight a whole line with single click. For example if I click on a word on the 15th line I want the whole line to be highlighted and also get some metadata for that specific line like line number in whole pdf, page number etc etc. Note that by line I dont mean lines which are seperated by "\n" but punctuations such as "." ";" "!" "?"

I have tried react-pdf and react pdf-viewer but couldnt find anything that supports these out of the box.

[1]: How to highlight the pdf page text based upon the line number in reactjs answer was helpful and it was creating highlights but I couldnt generate the metadata dynamically. And the second question still remains.

Towhid.kahn
  • 1
  • 1
  • 1
  • you can use tool like PDF.js, to extract the pdf content to render in web page and then you can define your like as need on the content – Rajiv Sharma Aug 09 '23 at 20:48
  • Thanks for clearing this out. I thought its just one after another line line txt files. So not how can I get the exact coordinates for each lines to highlight nicely. Maybe I can save those coordinates nicely indexed after that. – Towhid.kahn Aug 10 '23 at 06:13

0 Answers0