You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ipcMain.on('print',(event,url,id)=>{console.log('Print to pdf started')console.log(id)varfilepath=path.join(app.getPath('desktop'),'factuur-'+id+'.pdf')varoptions={// marginsType: 0,pageSize: 'A4'as'A4',// This needs to be one of the specific allowed string literalsprintBackground: true,printSelectionOnly: true,landscape: false}letwin=newBrowserWindow({show: false,webPreferences: {nodeIntegration: true}});// console.log(url)if(url.startsWith('http'))win.loadURL(url);elseif(isProd)win.loadURL('app://.'+url);elsewin.loadURL(`http://localhost:${process.argv[2]}`+url);win.webContents.on('did-finish-load',()=>{win.webContents.printToPDF(options).then(data=>{fs.writeFile(filepath,data,function(err){if(err){console.log(err);}else{console.log('PDF Generated Successfully');}console.log('Done')});}).catch(error=>{console.log(error)});});})
Now is win.webContents.printToPDF not working with a NextJS page, only with an external website even if that one is a NextJS based website. Am I doing something wrong or is this just a known or unknow issue. It currently retuns a blank page
The text was updated successfully, but these errors were encountered:
My current code is:
Now is win.webContents.printToPDF not working with a NextJS page, only with an external website even if that one is a NextJS based website. Am I doing something wrong or is this just a known or unknow issue. It currently retuns a blank page
The text was updated successfully, but these errors were encountered: