优化打印机

This commit is contained in:
gyq
2024-04-03 17:25:22 +08:00
parent a57b45160e
commit ca4eec636a
9 changed files with 175 additions and 31 deletions

View File

@@ -48,7 +48,7 @@ app.whenReady().then(() => {
// 创建打印小票子窗口
const printWin = new BrowserWindow({
show: true,
show: false,
width: 464,
height: 2206,
webPreferences: {
@@ -71,8 +71,10 @@ app.whenReady().then(() => {
})
// 执行打印操作
printWin.on('printStart', (event, arg) => {
ipcMain.on('printStart', (event, arg) => {
console.log(arg);
const _parmas = JSON.parse(arg)
console.log(_parmas)
let name = _parmas.deviceName
printWin.webContents.print({
silent: true,