You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I get the X,Y coordinates when the user taps on a PDF? I have tried many times, but still can't exactly get the X and Y coordinates that would be correct. The solution that seems the most useful would be this: #757 (comment)
but I can't access the pdfFile variable, since it is not accessible from outside the package:
'pdfFile' is not public in 'com. github. barteksc. pdfviewer. PDFView'. Cannot be accessed from outside package.
Is there another workaround? I need the X,Y coordinates to send them to a web service along with the PDF file where some text will be inserted at the provided coordinates.
Thanks!
The text was updated successfully, but these errors were encountered:
You can clone the library and make some adjustments, if you need the pdfFile you can expose a method in the PdfView: public PdfFile getPdfFile() { return pdfFile; }
and set public class PdfFile
because PdfFile is package visibility.
Now in order to make use of the function convertScreenPointToPdfPagePoint() you have to make changes in the pdfium-android library.
Currently in the library they use:
api 'com.github.barteksc:pdfium-android:1.9.0'.
But that library does not have the function you mention, since it is a pull request that was closed (I don't understand why).
I tried to add pdfium-android and implement the functions manually but it brings problems with the ndk and some .so that are not compiled in the apk.
After so much, what a surprise “Infomaniak” has already fixed it and we can make use of it, moreover, he already applied the convertScreenPointToPdfPagePoint() method and update proyect !!!
Credits: Pdfium fork
With this you have everything to obtain the correct X,Y point.
How can I get the X,Y coordinates when the user taps on a PDF? I have tried many times, but still can't exactly get the X and Y coordinates that would be correct. The solution that seems the most useful would be this:
#757 (comment)
but I can't access the pdfFile variable, since it is not accessible from outside the package:
'pdfFile' is not public in 'com. github. barteksc. pdfviewer. PDFView'. Cannot be accessed from outside package.
Is there another workaround? I need the X,Y coordinates to send them to a web service along with the PDF file where some text will be inserted at the provided coordinates.
Thanks!
The text was updated successfully, but these errors were encountered: