Comments (2)
Yes, I didn't have any problem. Are you sure that you installed it correctly? it's a bit tricky for Windows users.
I Used this code, It might be helpful. Don't forget to turn off Windows firewall for port 3000.
var fs = require('fs')
var Printer = require('ipp-printer')
var config = require('rc')('ipp-printer', {
name: 'ipp-printer', dir: process.cwd(), port: 3000
})
var printer = new Printer(config)
printer.on('job', function (job) {
console.log('[job %d] Printing document: %s', job.id, job.name)
var dir = 'C:\docs_for_print\'+printer.userId
try {
fs.mkdirSync(dir)
} catch (err) {
if (err.code !== 'EEXIST') throw err
}
var filename = 'job-' + job.id + '-' + Date.now() + '.ps' // .ps = PostScript
var file = fs.createWriteStream(dir+'\'+filename)
console.log('UserID = ', printer.userId, ' :: username = ', printer.userName)
job.on('end', function () {
console.log('[job %d] Document saved as %s', job.id, filename)
})
job.pipe(file)
})
printer.server.on('listening', function(){
console.log('Server starts at %s', printer.port)
})
from ipp-printer.
I have the same problem on a Ubuntu 20.04 machine. Nodejs 16.13.
My code:
var fs = require('fs')
var Printer = require('ipp-printer')
var printer = new Printer({name: 'My Printer'})
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)
})
printer.on('operation', function (op) {
console.log(op)
})
The command I run:
export DEBUG=* && node app
The result:
ipp-printer printer "My Printer" is listening on ipp://****:41229/ +0ms
ipp-printer printer "My Printer" changed state to idle +1ms
ipp-printer advertising printer "My Printer" on network on port 41229 +0ms
I can add the printer in my system's printers and firefox detect it as a printer as well. But no job is submitted and nothing is logged when I submit a print job.
Is there any solution?
from ipp-printer.
Related Issues (20)
- Document Remains in Queue After Printing HOT 2
- Very slow on low cpu computers
- Does not work with ipp 2.0
- ipp-server does not respont on a job HOT 2
- you're a great guy!
- iOS Client repeating POST request after server return HTTP 401 Unauthorized error
- iOS Client not sending number of copies
- Need someone to continue the project HOT 1
- job.attributes() missing attributes from ATTR_GROUP_JOB_TMPL HOT 2
- Is there any simple example or instruction how to use ipp-printer on windows HOT 4
- color setting and copies attribute
- Is there any way to destroy existing printer after its creation?
- Set ipp-printer to get pdf format instead of postscript HOT 3
- Can I configure global IP address where printer is installed in windows? HOT 1
- Printer Server responds very late (>1 minute) on some Windows 7 machines. HOT 1
- [SUGGESTION] Docker image
- When starting printer in 2 Pc's connected in same network, It will throw an error.
- Unable to receive printjob from StoreHub POS
- Donot show in windows printer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipp-printer.