PrintShare 安卓 打印API

来源:互联网 发布:socket编程 tcp udp 编辑:程序博客网 时间:2024/06/07 17:57

Android Developers

If you an Android developer, you can easily integrate your application with PrinterShare to provide printing capabilities to your users. We use intent mechanism to trigger print jobs on the phone. You can inject the following code into your app at the place where printing is required:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setPackage("com.dynamixsoftware.printershare");
i.setDataAndType(data_uri, data_type);
startActivity(i);

Where:

data_uri - Uri of the object to print, such as "file:///sdcard/something.pdf" or "content://something"

data_type - Mime type. The following mime types are supported:

"application/pdf"
"text/html"
"text/plain"
"image/png"
"image/jpeg"
"application/msword" - .doc
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" - .docx
"application/vnd.ms-excel" - .xls
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - .xlsx
"application/vnd.ms-powerpoint" - .ppt
"application/vnd.openxmlformats-officedocument.presentationml.presentation" - .pptx

Feel free to contact us if you need more information about application integration.


0 0
原创粉丝点击