-1

I am new to android and i would like to know how to read selected word from a PDF file. My idea is that when i open a PDF book in android and highlight or select a word from the PDF, My app should be able to get the selected/highlighted word. I am planing to make Instant Dictionary App that can help anyone to improve their English by selecting any text from the PDF and translating it instantly. Could anyone please explain to me how to get the selected word/highlighted from PDF reader and what API i should use ? I have found some code for getting the selecting code from an Edit-Text:

EditText etx=(EditText)findViewById(R.id.editext);

int startSelection=etx.getSelectionStart();

int endSelection=etx.getSelectionEnd();

String selectedText = etx.getText().substring(startSelection, endSelection);
Omga
  • 11
  • 4

1 Answers1

0

You can use MuPDF Library for displaying PDFs and Extracting Text on Android.
Here are some important links that can help you in integrating MuPDF in your application.
Integrate MuPDF Reader in an app
How to integrate mupdf library?
I hope this helps.

Community
  • 1
  • 1
Salman Khakwani
  • 6,684
  • 7
  • 33
  • 58
  • thank you very much MrSMAK sure this will helps me. but my app dose not read pdf i use adobe reader, my app only get the word that i have selected or highlighted in adobe reader .it will be running in the background. so is it possible to do this . cheers – Omga Nov 04 '13 at 12:14