不带打印对话框打印 Android [英] Print without print dialog Android

查看:53
本文介绍了不带打印对话框打印 Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚开发的简单安卓应用.我有通过 api google 在 android 4.4 版中工作的打印功能.

Simple Android App just developed. I have the printing functionality working in android version 4.4 via api google.

无论如何,我的最终目的是在没有任何 ui 界面的情况下自动打印到默认打印机.打印内容是简单的 html.我需要一些自定义代码来解决此问题.

Anyway my final purpose is to print automatically to default printer without any ui interface. Print content is simple html. I need some custom code to resolve this issue.

亲切的问候达尼洛

推荐答案

我认为,我们无法隐藏打印对话框,因为,PrintManager 类是最终的.所以,我们不允许覆盖它.

I think, We can't able to hide that Print Dialog, coz, PrintManager class is final. So, We are not allowed to override that.

当您从活动中调用此 print(String, PrintDocumentAdapter, PrintAttributes) 时,它会启动打印作业,还会调出系统打印 UI.

When you call this print(String, PrintDocumentAdapter, PrintAttributes) from an activity, It starts Print jobs also it will bringing up the system print UI.

如果你想要一个打印文档的例子,你可以参考这个Android-wifi-打印 - GitHub.这只是一个使用wifi打印机打印文档的原型.

If you want an example for Printing a Document you can refer to this Android-wifi-print - GitHub. This is just a prototype for printing a document using wifi printer.

这篇关于不带打印对话框打印 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆