优化打印机
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user