Electron 电子印刷发行
您好,我想打印一个页面,但不是实际可见的页面,我想制作一个隐藏页面,然后打印该页面。我只是有一个小问题,当我想打印我的页面时,我使用的Electron 电子印刷发行,electron,Electron,您好,我想打印一个页面,但不是实际可见的页面,我想制作一个隐藏页面,然后打印该页面。我只是有一个小问题,当我想打印我的页面时,我使用的确实在Electron中完成了加载事件,但这将在我的状态完全加载到文本字段之前发生。有什么建议吗 printWindow.webContents.once('did-finish-load', () => { printWindow.webContents.print(options, (success, failureReason) =>
确实在Electron中完成了加载
事件,但这将在我的状态完全加载到文本字段之前发生。有什么建议吗
printWindow.webContents.once('did-finish-load', () => {
printWindow.webContents.print(options, (success, failureReason) => {
if (!success) {
event.sender.send('print:currnetPageError', failureReason);
printWindow.destroy();
} else {
event.sender.send('print:currentPageRes');
printWindow.destroy();
}
});
});