How to print x copy ?
How can I print x times a document ?
I used this module only to print direct commands. To print x copies I suppose you can achieve this by using command attributes.
Feel free to share your solution
You can use option argument to pass CUPSOptions Like:
printer.printDirect({data:original
, type: 'JPEG'
, options: {'copies': 2}
, success:function(jobID){
console.log("sent to printer with ID: "+jobID);
}
, error:function(err){console.log(err); }
});
So, I am still unable to get multiple copies out of my printer using this library.
If I understand correctly then the printDirect() method can take an options argument which should be a list of CUPS options in JSON format.
According to the CUPS documentation, the argument which triggers multiple copies to be printed is -n.
https://www.cups.org/doc/options.html
When I try it in my code, it doesn't work.... anyone got any ideas?
function print (printJobObject) {
const printJobOptions = {
'-n': Number(printJobObject.copies)
}
printer.printDirect({
data: printJobObject.data,
printer: printJobObject.printerName,
type: 'RAW',
options: printJobOptions,
success () {
logger.info('printed')
},
error (err) { logger.error(err) }
})
}