Can we take a print from Web View?


My simple question is Can we Print the page from Web View through WIFI printing?
I have made one page and displayed in Web View so, can i print that page?
In emulator it doesn’t get any options for that, But in android wifi support phone have the print option.
Please help.


Try below code

public  void createWebPagePrint(WebView webView) {
	    PrintManager printManager = (PrintManager) getSystemService(Context.PRINT_SERVICE);
	    PrintDocumentAdapter printAdapter = webView.createPrintDocumentAdapter();
	    String jobName = getString(R.string.webapp_name) + " Document";
	    PrintAttributes.Builder builder = new PrintAttributes.Builder();
	    PrintJob printJob = printManager.print(jobName, printAdapter,;
	    	Toast.makeText(getApplicationContext(), R.string.print_complete, Toast.LENGTH_LONG).show();
	    else if(printJob.isFailed()){
	    	Toast.makeText(getApplicationContext(), R.string.print_failed, Toast.LENGTH_LONG).show();
	    // Save the job object for later status checking

Answered By – user1035292

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published