美文网首页
佳能IP100 android蓝牙打印

佳能IP100 android蓝牙打印

作者: 橘子神明 | 来源:发表于2019-12-23 13:26 被阅读0次

对着设备绕了一圈,扣扣挖挖,发现没有蓝牙模块。淘宝买了一个BU-30蓝牙模块装上去就可以用了。
开头采用分享的方式,发现图片会歪一边,文档则会乱码。
后面采用printershare来解决。
1.安装一个破解版printershare.apk
2.写个工具类

public void printPdf(Context context,String pdfpath)
{
    File pdf= new File(pdfpath);    
    ComponentName comp = new ComponentName(thridAppPkg,thridAppCls);
    Intent intent = new Intent();
    try {
        if (Build.VERSION.SDK_INT >= 24) {//7.0 Android N
            //com.xxx.xxx.fileprovider为上述manifest中provider所配置相同
            Uri uri = FileProvider.getUriForFile(context, "com.xunfa.kf.safetyapp.provider", pdf);
            intent.setComponent(comp);
            intent.setAction("android.intent.action.VIEW");
            intent.setType("application/pdf");
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
            intent.setData(uri);
        } else {
            intent.setComponent(comp);
            intent.setAction("android.intent.action.VIEW");
            intent.setType("application/pdf");
            intent.setData(Uri.fromFile(pdf));
        }
        context.startActivity(intent);
    }catch (Exception e)
    {
        e.printStackTrace();
    }
}

3.调用printPdf方法写入pdf路径打印,第一次需要加载驱动,和加载预览模块。挂VPN的很快久搞定。

相关文章

  • 佳能IP100 android蓝牙打印

    对着设备绕了一圈,扣扣挖挖,发现没有蓝牙模块。淘宝买了一个BU-30蓝牙模块装上去就可以用了。开头采用分享的方式,...

  • Android开发(42) 使用andorid操作蓝牙打印机

    需求 使用android发起打印任务,通过蓝牙连接打印机。条件如下:打印机:南京富士通DPK760E,具有蓝牙功能...

  • android 蓝牙打印

    1. 首先 构造一个打印的业务类 public class PrintBean { public static f...

  • ReactNative相关

    android版蓝牙打印机使用方式 导入 gprintersdkv2.1.4.jar jar包 导入 Blueto...

  • swift 蓝牙连接浩顺58热敏小票打印机。

    按照文档要求,在设置->蓝牙里面找到打印机,输入蓝牙密码并连接,这个流程适用于android,但不用于苹果。iph...

  • 蓝牙开发《基础篇一》

    最近项目中使用到蓝牙打印机,通过蓝牙连接蓝牙打印机进行打印功能。在此对蓝牙知识进行归纳输出一波,达到巩固之效果。 ...

  • app连接蓝牙打印机实现打印

    app连接蓝牙打印机实现打印并排版_鬼妖妖的博客-CSDN博客_app蓝牙打印

  • 蓝牙开发《基础篇三》

    最近项目中使用到蓝牙打印机,通过蓝牙连接蓝牙打印机进行打印功能。在此对蓝牙知识进行归纳输出一波,达到巩固之效果。蓝...

  • 蓝牙开发《基础篇二》

    最近项目中使用到蓝牙打印机,通过蓝牙连接蓝牙打印机进行打印功能。在此对蓝牙知识进行归纳输出一波,达到巩固之效果。蓝...

  • Android连接蓝牙打印机

    前言 在之前写过一篇Android操作蓝牙打印机(上)[https://www.jianshu.com/p/534...

网友评论

      本文标题:佳能IP100 android蓝牙打印

      本文链接:https://www.haomeiwen.com/subject/snyznctx.html