Tag: 打印

从电子应用打印

我试图从电子应用程序使用节点打印机 ,但是一旦我添加了使用打印机的行,应用程序就会崩溃。 控制台输出: [1] 9860 segmentation fault (core dumped) node_modules/electron-prebuilt/dist/electron. 这是我正在运行的应用程序。 我只在电子文档中提供的简单应用示例中添加了打印行: var app = require('app'); // Module to control application life. var BrowserWindow = require('browser-window'); // Module to create native browser window. var printer = require('printer'); // Report crashes to our server. require('crash-reporter').start(); // Keep a global reference of the window object, if you […]

无法通过IPP在另一个纸盘上打印

我正在尝试使用IPP(Internet打印协议)在第二个纸盒上打印文档。 我正在使用这个NPM IPP库 。 但是,在任何时候我尝试打印文档,我的打印机显示一条消息,我需要将纸张添加到第一个纸盒和控制台输出说: Printed: successful-ok 。 var ipp = require("ipp"); var PDFDocument = require("pdfkit"); var concat = require("concat-stream"); var doc = new PDFDocument; doc.text("Hello World"); doc.pipe(concat(function (data) { var printer = ipp.Printer("MY_URL"); var file = { "operation-attributes-tag": { "requesting-user-name": "admin", 'attributes-charset': 'utf-8', 'attributes-natural-language': 'de' }, "printer-attributes": { "media-col": { "media-source": "tray-2" }, }, […]