Answer the question
In order to leave comments, you need to log in
How to overcome Chinese AndroidBOX to get PrintDocumentAdapter working?
There is a cheap TVBOX with Android 10.
The principle is out of focus app = unloaded from memory. elevated to absolute on it.
//create object of print manager in your device
PrintManager printManager = (PrintManager) Objects.requireNonNull(getContext()).getSystemService(Context.PRINT_SERVICE);
//create object of print adapter
PrintDocumentAdapter printAdapter = webView.createPrintDocumentAdapter();
//provide name to your newly generated pdf file
String jobName = "Html2Print";
//open print dialog
if (printManager != null) {
printManager.print(jobName, printAdapter, new PrintAttributes.Builder().setMinMargins(new PrintAttributes.Margins(250, 250, 250, 250)).build());
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question