thiagoelg / node-printer

Native node.js printer
125 stars 75 forks source link

Does this work on Windows? #47

Open alexb148 opened 2 years ago

alexb148 commented 2 years ago

Hello, can anyone tell me if this should work on Windows?

The readme seems to suggest that Windows is supported, but when trying to print using Printer.printFile() it works fine on macOS, but gives me the message 'Error: Not yet implemented on Windows'.

My code is essentially:

const Printer = require('@thiagoelg/node-printer');

Printer.printFile({
    filename: newFilename,
    // printer: printerName, // printer name, if missing then will print to default printer
    options: {
        'fit-to-page': true,
    },
    success: function (jobID) {
        resolve(jobID);
    },
    error: function (err) {
        reject(err);
    },
})

This is on an up-to-date version of Windows 10 on a Surface Go tablet.

If this package does not support Windows it would be useful to know, thank you.

itsthejoker commented 2 years ago

I can successfully print using printDirect with RAW encoding for my T88V on Windows 11, if that helps.

driehle commented 1 year ago

Look at the source code for Windows: https://github.com/thiagoelg/node-printer/blob/main/src/node_printer_win.cc#L746

The printFile function is simply not implemented. So this cannot work on Windows. I guess you'll have to use printDirect.