android-print-framework

How to change default print option in Android print class

我的梦境 提交于 2019-12-11 04:37:30
问题 I write a print class in Android app, and I want to save the printAttribute before rotation and reconnect to the printer using the former printAttribute, but when I pass the oldPrintAttribute it does not work, the print dialog still shows the default option, this is my code. PrintManager printManager = (PrintManager) context.getSystemService(Context.PRINT_SERVICE); String jobName = PdfFragment.sProjectPrefix + " " + getFileNameFromPath(mPdfDocumentName); printManager.print(jobName, new

is this possible to print the web page in android without popup?

若如初见. 提交于 2019-12-10 10:08:00
问题 I am using default android printer option (android version 4.4) I want to byPass printManager adapter popup. how to hide the popup and give a direct print to the printer in android 回答1: you cannot extend PrintManager class. It is a final class .Please check below link http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/print/PrintManager.java These guys have designed their own printing framework.Where they are designing their own dialog.Have a

Generate and print a PDF with specific size in Android

我只是一个虾纸丫 提交于 2019-12-07 05:06:41
问题 I'm working in an Android application, and I want to generate and print a PDF. But I'm having some trouble. I need to generate the PDF with 80mm of width , and the height may vary. I'm trying this: public class PDFGenerator implements Runnable { private Context ctx; private View view; private Intent mShareIntent; private OutputStream os; public PDFGenerator(Context ctx, View view) { this.ctx = ctx; this.view = view; makeAndSharePDF(); } public void makeAndSharePDF() { new Thread(this).start()

is this possible to print the web page in android without popup?

…衆ロ難τιáo~ 提交于 2019-12-05 20:51:05
I am using default android printer option (android version 4.4) I want to byPass printManager adapter popup. how to hide the popup and give a direct print to the printer in android you cannot extend PrintManager class. It is a final class .Please check below link http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/print/PrintManager.java These guys have designed their own printing framework.Where they are designing their own dialog.Have a look http://apf.isb-vietnam.com/index.php/programming-with-apf.html Daniel Kvist It seems to me like the

Generate and print a PDF with specific size in Android

五迷三道 提交于 2019-12-05 11:26:55
I'm working in an Android application, and I want to generate and print a PDF. But I'm having some trouble. I need to generate the PDF with 80mm of width , and the height may vary. I'm trying this: public class PDFGenerator implements Runnable { private Context ctx; private View view; private Intent mShareIntent; private OutputStream os; public PDFGenerator(Context ctx, View view) { this.ctx = ctx; this.view = view; makeAndSharePDF(); } public void makeAndSharePDF() { new Thread(this).start(); } @TargetApi(Build.VERSION_CODES.KITKAT) public void run() { PrintAttributes printAttrs = new

Print Pdf file via Bluetooth Printer Android

拜拜、爱过 提交于 2019-12-03 04:50:43
In My project Need to print Pdf file Via Bluetooth Printer. I write a code to print via pdf Its for fine for a Text, But I want to Print PDF file on Bluetooth printer. My java Code to Print Text @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lv= (ListView) findViewById(R.id.listView1); // listdata(lv); try { // we are goin to have three buttons for specific functions Button openButton = (Button) findViewById(R.id.open); Button sendButton = (Button) findViewById(R.id.send); Button closeButton = (Button)

How do I print a WebView using KitKat 4.4 print API via reflection?

余生长醉 提交于 2019-12-01 11:33:40
I need to support printing on KitKat devices but my target SDK is 13 (changing is not an option). Specifically I need to print a webview. This is the API for printing a webview: http://developer.android.com/training/printing/html-docs.html It's an old one but printing is kind of usefull so this could be good to work correctly. (Without reflection ;)) A better way to work with devices version. No try-catch needed, just need to add some messages before the return or you just hide the button/menu/... depending on the same condition. @TargetApi(Build.VERSION_CODES.KITKAT) private void

How do I print a WebView using KitKat 4.4 print API via reflection?

删除回忆录丶 提交于 2019-12-01 07:47:26
问题 I need to support printing on KitKat devices but my target SDK is 13 (changing is not an option). Specifically I need to print a webview. This is the API for printing a webview: http://developer.android.com/training/printing/html-docs.html 回答1: It's an old one but printing is kind of usefull so this could be good to work correctly. (Without reflection ;)) A better way to work with devices version. No try-catch needed, just need to add some messages before the return or you just hide the

Hide Android KitKat 4.4 printing dialog

心不动则不痛 提交于 2019-11-30 15:17:01
问题 I am working on a kiosk app which needs to print. I have the printing functionality working but the problem is it shows a dialog and as a kiosk app we need to keep things simple and limit what users can do. Is there a way to print without showing the dialog? I don't care if it prints to the "default" printer or if it's something I'll need to pass parameters into. I used this for reference: http://developer.android.com/training/printing/html-docs.html 来源: https://stackoverflow.com/questions

Hide Android KitKat 4.4 printing dialog

断了今生、忘了曾经 提交于 2019-11-30 13:50:03
I am working on a kiosk app which needs to print. I have the printing functionality working but the problem is it shows a dialog and as a kiosk app we need to keep things simple and limit what users can do. Is there a way to print without showing the dialog? I don't care if it prints to the "default" printer or if it's something I'll need to pass parameters into. I used this for reference: http://developer.android.com/training/printing/html-docs.html 来源: https://stackoverflow.com/questions/20005975/hide-android-kitkat-4-4-printing-dialog