mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
refactor: printToPDF should be headless (#33654)
This commit is contained in:
@@ -86,10 +86,11 @@ app.whenReady().then(() => {
|
||||
mainWindow.webContents.print()
|
||||
|
||||
mainWindow.webContents.printToPDF({
|
||||
marginsType: 1,
|
||||
pageSize: 'A3',
|
||||
margins: {
|
||||
top: 1
|
||||
},
|
||||
printBackground: true,
|
||||
printSelectionOnly: true,
|
||||
pageRanges: '1-3',
|
||||
landscape: true
|
||||
}).then((data: Buffer) => console.log(data))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user