Open aabanaag opened 7 years ago
@aabanaag this works for me in electron
let imageData = canvas.toDataURL('image/jpeg')
let base64Data = imageData.replace(/^data:image\/\w+;base64,/, '')
let dataBuffer = Buffer.from(base64Data, 'base64')
printer.printDirect({
data: buffer,
type: 'JPEG',
printer: this.printer,
success: function (jobID) {
console.log('sent to printer with ID: ' + jobID)
},
error: function (err) {
console.log(err)
}
})
its says Error: StartDocPrinterW error: code: 1804, message: The specified datatype is invalid. Had a same issues...
Hi, I have a question if printing an image using dataURL will be possible? Also any updates on sending the print via buffer? It is possible to utilize async/await from ES6?
Bro How did you managed to get this functionality? I'm having a same issue
Hi, I have a question if printing an image using dataURL will be possible? Also any updates on sending the print via buffer? It is possible to utilize async/await from ES6?