Navigate to a specific text of a pdf using its coordinates

Viewed 84

I have a pdf uploaded in a html dom. I have the pdf and the coordinates (x,y) of a text/line/paragraph from the pdf. I want to navigate to the exact location of that text/line in the pdf using the coordinates as input parameters and highlight the area enclosed by the coordinates.

Is it acheivable using pdf.js ?

1 Answers

Generally those methods within browsers are highly variable based on system and version so take for example attempting to scroll to the zzzzz line
this works in Chromium/Edge:-
https://africau.edu/images/default/sample.pdf#page=1&view=fitH&zoom=0,0,225

enter image description here

For Firefox PDF.js to get to a similar place you need
https://africau.edu/images/default/sample.pdf#page=1&zoom=FitH,625

enter image description here

For a word search Firefox works but modern chrome or chrome with acrobat appears not to work also see https://stackoverflow.com/a/73299830/10802527

Related