I'm using following code to print web-view from android app.
private void createWebPrintJob(WebView webView) {
PrintManager printManager = (PrintManager) this
.getSystemService(Context.PRINT_SERVICE);
PrintDocumentAdapter printAdapter =
webView.createPrintDocumentAdapter();
String jobName = getString(R.string.app_name) +
" Print Test";
printManager.print(jobName, printAdapter,
new PrintAttributes.Builder().build());
}
But android print panel not showing the available WiFi printer in print panel.
Note:
I encountered the same issue. It appears that some devices lack cloud printing and therefore will need to install the official Google Cloud Print plugin/app.
You could suggest users to download the app if there are no printers being displayed.
https://play.google.com/store/apps/details?id=com.google.android.apps.cloudprint
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.