Printing pdf file from network shared printer in android -
i have pdf file stored on sd card named "test.pdf". have opened file in application using following code:
b.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub file file = new file(environment.getexternalstoragedirectory().getabsolutepath() +"/"+ "test.pdf"); intent target = new intent(intent.action_view); target.setdataandtype(uri.fromfile(file),"application/pdf"); target.setflags(intent.flag_activity_no_history); intent intent = intent.createchooser(target, "open file"); try { startactivity(intent); } catch (activitynotfoundexception e) { // instruct user install pdf reader here, or toast.maketext(getapplicationcontext(), "not found", toast.length_short).show(); } } });
pdf displayed inside application. want print pdf file using shared printer. how can that?
Comments
Post a Comment