Search code examples
iosswiftpdfminer

transform pdfminer bbox coordinates to iOS screen


I am doing an iPad application project in swift where I need to extract pdf word bbox coordinates and transform it to the iPad screen coordinates. The goal is that I be able to detect when a word is being touched.

I am using a webview to display the pdf, and I am using pdfminer library in python to extract word bboxes (I extract character bboxes and I can get words by separating from spaces between words). But I do not know how to transform pdfminer word coordinates to iOS screen.

I can explain more or dd code and screenshots if needed. Any help will be very much appreciated!


Solution

  • I solved this by modifying and using pdfkitten instead of pdfminer.