0

I'm working on a POS app and I am trying to print to the reciept printer through usb, when running the application on mac it send the html perfectly and prints the page, but on windows its just print a small tiny piece of paper and its empty.

I tried checking if the html was generated on both and it is, but on the windows version its just not printing the same,

  let printWin:any = null;
  printWin = new BrowserWindow({ show: false });
    printWin.on('closed', () => {
        printWin = null;
    });

    printWin.loadURL('data:text/html;charset=utf-8,' + encodeURI(arg));

    printWin.webContents.on('did-finish-load', () => {
        printWin.webContents.print({ silent: true }, (success:any, errorType:any) => {
            if (success) {
                win?.webContents.send('log-message', 'Receipt printed successfully');
            } else {
              win?.webContents.send('log-message', `Failed to print receipt: ${errorType}`);
            }
            
            printWin.close();
        });
    });

I am using a MC-Print 3 Printer from star micronics

1

0

Browse other questions tagged or ask your own question.