const printWindow = new BrowserWindow({
width: 800,
height: 600,
show: false,
webPreferences: {
nodeIntegration: true,
webSecurity: false,
devTools: false,
},
dpi: 96,
});
const options = {
silent: true,
deviceName: SelectedPrinter,
}
const callback = (success, errorType) => {
if (!success) console.log(errorType)
}
printWindow.loadURL(tmpPath);
printWindow.webContents.on('did-finish-load', () => {
printWindow.webContents.print(options, callback)
})
That's my code upon, I create a document as HTML file, and load in a new BrowerWindow.
On some computer, there OS are all windows 7, doen't have callback.
It can executing the function 'webContent.print', and no callback response.
I saw printer has received an HTML file, but pages is N/A, and size is empty.
I don't know what is going on those devices, is that an OS problem or a hardware problem?