1

I am developing new application which have print wireless feature. And I am using ePrint technology. PDF file which I generated before, I want to preview it directly using ePrint application (apk) like below screenshot : enter image description here

I have URI for my pdf file, then I already decompiled ePrint application (apk), and found this one in its manifest. I am not sure, but I think below screenshot refers to preview activity.

enter image description here

So how can I open directly ePrint Preview activity from my application, and I have parameter URI file which I want to print ?

Thank you in advance.

Agoeng Liu
  • 674
  • 3
  • 10
  • 30

1 Answers1

0

Try this: Following code might be solve your problem.

It will work only if you have ACTION_PRINT in your libraries.

File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/pdf_name.pdf");
Intent intent = new Intent();
intent.setAction("org.androidprinting.intent.ACTION_PRINT");
intent.setDataAndType(Uri.fromFile(file), "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
Amy
  • 4,034
  • 1
  • 20
  • 34