DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.05k stars 1.85k forks source link

How to convert the screen coordinate to pdf page coordinates ? #999

Closed hehonghui closed 3 years ago

hehonghui commented 3 years ago

I want to implement text selection, the key step is:

  1. the user touch the screen, and i get the screen coordinates;
  2. convert screen coordinates to page coordinates
  3. get text from current page with coordinates

But i can't get the right page coordinates, so that i get the correct text. Anyone can share some workaround ?

taichushouwang commented 3 years ago

@hehonghui hi, I have the same demand with you, can you tell me, how do you solve it?