How to print a DIV in ElectronJS

后端 未结 2 436
执念已碎
执念已碎 2020-12-08 11:40

i\'m trying to convert my web into an app made in ElectronJS

in my web i print a div with a barcode. this works pretty fine, but in electronjs i can\'t reach this.

2条回答
  •  有刺的猬
    2020-12-08 11:58

    Thank you, works for printing with print() as well

    ipcMain.on('print', (event, content) => {
        workerWindow.webContents.send('print', content);
    });
    
    ipcMain.on('readyToPrint', (event) => {
        workerWindow.webContents.print({});
    });
    

    (events are renamed accordingly)

提交回复
热议问题