0

I have a requirement to get a position of an element from the pdf . Currently, I am using ng2pdf viewer.

stackblitz: when I clicked on the image inside pdf I need the coordinates of the clicked element.

https://stackblitz.com/edit/ng2-pdf-viewer

How to do this by using this library in angular or recommended for any other library also good.

enter image description here

Mohamed Sahir
  • 2,482
  • 8
  • 40
  • 71

1 Answers1

0

I have to do the same thing, and I don't know if there's a library that has this functionality.

The naive approach is to make a Canvas above the PDF visualizator and then get the cursor position of it (in relation to the canvas), then you can make a method to do the conversion that you are showing.

d219
  • 2,707
  • 5
  • 31
  • 36