I have a .PDF file saved on my sdcard. I need to read the content of .PDF file and show it in a TextView.
How do I do this?
I have a .PDF file saved on my sdcard. I need to read the content of .PDF file and show it in a TextView.
How do I do this?
You could use something like this for example - get the file path and open it as a new intent:
// get the file path from the external storage (SD card)
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/yourPdfName.pdf");
Intent intent = new Intent(Intent.ACTION_VIEW);
// set the content type and data of the intent
intent.setDataAndType(Uri.fromFile(file), "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
// start the intent as a new activity
startActivity(intent);