I found a better way to achieve this, find the point coordinate in the html page
and then subtract from it the coordinate (position) of the div.textLayer
to find the coordinate
text in pdf displayed on the Internet.
To find the coordinate of the text in the actual pdf, find the aspect ratio and you
get the actual coordinate
example
if the text displayed on the Internet is 800x900
and the text coordinate
[(31,35),(40,35),(40,40),(31,40)]
and actual PDF size 612x792
find the corresponding area value in the actual pdf like this
(612/(800 / 31)),(792/(900/35))
and do it for all coordinates found online
i.e
(40,35),(40,40),(31,40)
NOTE: -
You might want to check out the PDF.js API called convertToPdfPoint
Viren source share