Skip to content

Instantly share code, notes, and snippets.

@m7mdra
Created July 1, 2017 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m7mdra/7546928cab94739d04b23837a2086a90 to your computer and use it in GitHub Desktop.
Save m7mdra/7546928cab94739d04b23837a2086a90 to your computer and use it in GitHub Desktop.
private void createWebPrintJob(WebView webView) {
PrintManager printManager = (PrintManager) getSystemService(Context.PRINT_SERVICE);
PrintDocumentAdapter printAdapter = webView.createPrintDocumentAdapter();
String jobName = getString(R.string.app_name) + " Document";
PrintJob printJob = printManager.print(jobName, printAdapter,
new PrintAttributes.Builder().build());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment