How to create a virtual printer using Node.js
Asked Answered
C

0

6

I try to create virtual printer like this enter image description here

I tried to use ipp-printer module create virtual printer but I can't add my printer

var fs = require('fs') 

var Printer = require('ipp-printer')

var printer = new Printer({name:"my-printer", port:8081})
printer.on('job', function (job) {
  console.log('[job %d] Printing document: %s', job.id, job.name)
  var filename = 'job-' + job.id + '.ps' // .ps = PostScript
  var file = fs.createWriteStream(filename)
  job.on('end', function () {
    console.log('[job %d] Document saved as %s', job.id, filename)
  })

  job.pipe(file)
})

I'can't see my-printer name in add printer screen

enter image description here

Cristiano answered 2/7, 2019 at 10:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.