Autoprint is not completely silent
See original GitHub issueNWJS Version : 0.26.3 Operating System : Mac OS 10.13
Expected behavior
When the main window is hidden, printing with autoprint: true
should send document to printer quietly without any pop ups.
Actual behavior
Main window appears on screen, print preview dialog flashes momentarily, then the printing starts.
How to reproduce
I created an app that sits in system tray and waits for specific data. When it gets that data, it prints a label on a label printer attached directly to the computer. To mitigate the problem somewhat, I added win.hide() right after printing. It hides the window no problem, however during the brief moment while the main window appears, it takes the focus away from whatever app it was in before. Is it possible to keep the main window always hidden? Or to print from some background window that is never visible in the first place?
package.json:
{
"name": "helloworld",
"main": "index.html",
"window": {
"show": false,
"show_in_taskbar": false
}
}
relevant part of index.html:
win.print({
autoprint: true, // do not display confirmation dialog
printer: printer.deviceName,
headerFooterEnabled: false,
landscape: true,
marginsType: 1,
mediaSize:{'name': 'Label', 'width_microns': 29000, 'height_microns': 89000, 'custom_display_name':'Label', 'is_default': true}
});
win.hide();
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
It would be great if anyone could give us a rough estimate for this to be fixed. It’s a pretty important issue for our use case (kiosk). I can see it’s currently labeled as P3 which doesn’t look very promising.
This is fixed in git and will be available in the next nightly build of 0.44 branch.