小编Rah*_*gia的帖子

节点USB打印机

在此输入图像描述任何人都知道如何为 Node.js 设置 USB 打印机。我无法为其配置界面。这是我的代码

enter code here const ThermalPrinter = require("../node-thermal-printer").printer;
                const Types = require("../node-thermal-printer").types;
                const electron = typeof process !== 'undefined' && process.versions && 
                                  !!process.versions.electron;

                async function testConnection () { 

                let printer = new ThermalPrinter({
                type: 'star',                                    
                interface: "Gold" //name of the printer
                });
                printer.print("hi");
                let isConnected = await printer.isPrinterConnected() 
                console.log("Printer connected:", isConnected);
                }
                 testConnection();
Run Code Online (Sandbox Code Playgroud)

usb thermal-printer printers node.js

4
推荐指数
1
解决办法
4005
查看次数

标签 统计

node.js ×1

printers ×1

thermal-printer ×1

usb ×1