我有一个程序,我使用 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});
});
在这里,我需要添加也将打印在同一个文档中的条形码或图像。我该怎么做?