优化打印机

This commit is contained in:
gyq
2024-04-18 09:22:30 +08:00
parent 51fe3266ce
commit 5bb73cb3b3
11 changed files with 665 additions and 61 deletions

View File

@@ -50,7 +50,7 @@ app.whenReady().then(() => {
const printWin = new BrowserWindow({
show: false,
width: 464,
height: 2206,
height: 1726,
webPreferences: {
// 集成网页和 Node.js也就是在渲染进程中可以调用 Node.js 方法
nodeIntegration: true,
@@ -74,14 +74,14 @@ app.whenReady().then(() => {
ipcMain.on('printStart', (event, arg) => {
console.log(arg);
const _parmas = JSON.parse(arg)
console.log(_parmas)
// console.log(_parmas)
let name = _parmas.deviceName
printWin.webContents.print({
silent: true,
deviceName: name,
pageSize: {
width: 58000,
height: 276000
height: 216000
},
scaleFactor: 80,
landscape: false,