kopia lustrzana https://github.com/inkstitch/inkstitch
handle cancel in save pdf dialog
rodzic
67027f0704
commit
0a41ad6f71
|
@ -44,6 +44,7 @@ app.on('window-all-closed', () => {
|
|||
ipcMain.on('print', function (event, pageSize) {
|
||||
mainWindow.webContents.printToPDF({"pageSize": pageSize}, function(error, data) {
|
||||
dialog.showSaveDialog(mainWindow, {"defaultPath": "inkstitch.pdf"}, function(filename, bookmark) {
|
||||
if (typeof filename !== 'undefined')
|
||||
fs.writeFileSync(filename, data, 'utf-8');
|
||||
})
|
||||
})
|
||||
|
|
Ładowanie…
Reference in New Issue