refactor: options parsing in WebContents.prototype.printToPDF() (#40257)

* refactor: options parsing in WebContents.prototype.printToPDF()

* tweak parsePageSize
This commit is contained in:
Milan Burda
2023-10-19 21:38:30 +02:00
committed by GitHub
parent 025af3500c
commit beb0cbc6d0
3 changed files with 52 additions and 141 deletions

View File

@@ -90,7 +90,11 @@ app.whenReady().then(() => {
},
printBackground: true,
pageRanges: '1-3',
landscape: true
landscape: true,
pageSize: {
width: 100,
height: 100
}
}).then((data: Buffer) => console.log(data));
mainWindow.webContents.printToPDF({}).then(data => console.log(data));