node.js - 节点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();
解决方案
推荐阅读
- css - Material-UI Input 组件下划线颜色
- ios - 圆形 UITableViewCell 仅底角或顶角,但它不起作用 Swift iOS 10
- java - 为什么我的 Java 进程在 docker 容器与主机之间消耗两倍的内存
- javascript - 正确确定标记是否在绘制的多边形内
- git - Visual Studio 2017 - 无法将提交的更改推送到本地存储库
- unit-testing - 我们如何使用 angulardart 中的测试包对异步函数进行单元测试?
- apache - 如何重定向桌面用户
- xslt-1.0 - xsl 键匹配以返回特定值
- javascript - 在异步请求的服务器端昂贵的过程中浏览器锁定
- python - 从excel导入mysql