【问题标题】:Connect wifi Printer to android device to take PDF print programatically using Printer Manager将 wifi 打印机连接到 android 设备以使用打印机管理器以编程方式进行 PDF 打印
【发布时间】:2015-12-29 06:30:36
【问题描述】:

我想将我的 wifi 打印机连接到我的 android 设备并使用打印机管理器打印 pdf。我在谷歌上搜索了很多虽然有很多像我这样的问题但我没有任何解决方案。我的打印机不是云准备好打印机。请帮助。在此先感谢...!!

【问题讨论】:

    标签: android pdf printing


    【解决方案1】:

    我假设您正在尝试使用打印管理器打印自定义文档。

    当你给 print cmd 一个对话框时,会出现一个无限期地显示“正在搜索打印机”的对话框。

    1. 从打印机打印测试文档,您将获得连接打印机所需的信息。

    2. 你要做的就是从 Play 商店为你的打印机下载“插件”。

    3. 下载后,您需要打开它并使用您在测试文档打印中获得的凭据连接到打印机。

    现在尝试从您的应用打印文档。

    【讨论】:

    • 感谢您的回复..!!让我先试试这个。
    • Hii @kevz 我得到了我的打印机的文档,但没有打印机 wifi 密码,虽然有 SSID。我需要它来建立连接。你能帮我解决吗。帮助赞赏..! !
    • @Divya Singh:让我们继续聊天:chat.stackoverflow.com/rooms/99174/…
    【解决方案2】:

    私人无效连接(蓝牙设备){

        //try to make a "Bond" if possible. Else return
        if (device.getBondState() == BluetoothDevice.BOND_NONE) {
            try {
                createBond(device);
            } catch (Exception e) {
                showToast("Failed to pair device");
    
                return;
            }
        }
    

    private void createBond(BluetoothDevice device) 抛出异常 {

        try {
            Class<?> cl = Class.forName("android.bluetooth.BluetoothDevice");
            Class<?>[] par = {};
    
            Method method = cl.getMethod("createBond", par);
    
            method.invoke(device);
    
        } catch (Exception e) {
            e.printStackTrace();
    
            throw e;
        }
    }
    

    【讨论】:

    • 我的打印机不是蓝牙设备,为什么我要绑定?
    猜你喜欢
    • 1970-01-01
    • 2010-09-14
    • 1970-01-01
    • 1970-01-01
    • 2012-12-19
    • 2011-02-22
    • 2017-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多