I am developing a pdf reader, as android don't have any native pdf viewer so i have to use third party pdf viewer. in that case i have chose the Adobe pdf viewer for android. I can open pdf file which are stored in sdcard of my device. Now i want to open password protected pdf file from my application. If user wants to open password protected pdf file manually then use have to provide password while opening. but i want to open those password pdf file from my application without any password prompt. Application provide the password,[apps knows the password] and without any password prompt, pdf will open.
currently if i want to open any password protected pdf file from my application then a password prompt is appeared and needs a password to open it.
I am using this code to open pdf from my stored pdf files in the /mnt/sdcard/testfolder
Here is the code
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
PackageManager packageManager = getPackageManager();
Intent testIntent = new Intent(Intent.ACTION_VIEW);
testIntent.setType("application/pdf");
List list = packageManager.queryIntentActivities(testIntent,
PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() > 0 && imagelist[(int) id].isFile()) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri uri = Uri.fromFile(imagelist[(int) id].getAbsoluteFile());
intent.setDataAndType(uri, "application/pdf");
startActivity(intent);
}
}
How to open password protected pdf file by providing password in android application programmatically.PLEASE HELP :(