【发布时间】:2020-05-29 01:57:51
【问题描述】:
我有一个程序,我使用 IPP 协议从 node.js 服务器向打印机发送命令。我在这里使用
var ipAddress='127.0.0.1';
var Printer = ipp.Printer("http://".concat(ipAddress).concat("/ipp/print"));
var dt = "";
dt = dt.concat("SINCOS Vending Machine Demo.\n\r", "Contact: ", phone, "\n\rProduct: ", product, "\n\rQuantity: ", quantity, "\n\rPrice: ", price, "\n\r");
var buffer1 = new Buffer(dt, 'utf8');
var msg = {
"operation-attributes-tag": {
"requesting-user-name": "John Doe"
},
"job-attributes-tag": {
"media": "na_letter_8.5x11in"
},
data: buffer1
};
Printer.execute("Print-Job", msg, function (err, suc) {
return res.send({error: false, message: suc});
});
在这里,我需要添加同样将打印在同一个文档中的条形码或图像。我该怎么做?
【问题讨论】:
-
打印机支持哪些文档格式 (pdl)?
-
我不知道。我使用的是三星的 M262x 282x 系列打印机。
-
使用 IPP,您可以查询打印机对象属性“document-format-supported”以获取可以打印的文件格式列表。
标签: javascript node.js network-printers ipp-protocol