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