我想在我的应用程序中打印pdf文件,所以我想使用安装在我的手机中的printershare应用程序。如何在我的Android应用程序中使用Printershare应用程序
如何使用那个printershare应用程序?以及如何通过intent发送pdf文件路径。
感谢
我想在我的应用程序中打印pdf文件,所以我想使用安装在我的手机中的printershare应用程序。如何在我的Android应用程序中使用Printershare应用程序
如何使用那个printershare应用程序?以及如何通过intent发送pdf文件路径。
感谢
这可以帮助你:
Intent i = new Intent(Intent.ACTION_VIEW);
i.setPackage("com.dynamixsoftware.printershare");
i.setDataAndType(data_uri, data_type);
startActivity(i);
其中:
data_uri
- Uri
对象打印,如 “文件:///sdcard/something.pdf”或“content:// something”
data_type
- MIME类型。以下MIME类型支持:
"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