NW window Print Bugged
See original GitHub issue0.21.3-sdk Windows: 10/7 Node: 6.9.5 Chrome: 56.0.2924.87(64-bit)
Git(OS-China) Project: Hongfund-DeskTop
Reproduction: Window.get().print();
let nw = require('nw.gui').Window;
let printer = '';
let printFile = ({
'autoprint': true,
'mediaSize': {'name': 'CUSTOM', 'width_microns': 279400, 'height_microns': 215900, 'custom_display_name':'Letter', 'is_default': true},
marginsType: 1,
headerFooterEnabled : false,
landscape: false,
shouldPrintBackgrounds: false,
copies: 0,
headerString: '',
footerString: ''
});
nw.get().print(printFile);
<style>
@media print{
.nextPage{
page-break-after: always
}
}
</style>
Using all above script commands:
printFile.autoprint == true
It will be just 2 pages the printer can be printed, the other pages over 2 will be blank papers. And the waiting time is so long for about 20-60 seconds.
printFile.autoprint == false
The print window of Chrome will be show, and everything will be correctly. But that window should be hidden from my project in my requirement.
My end goal is to hide the Chrome’s print window. Of course, the print functions can be run correctly and quickly. So, the ‘autoprint’ will be very important.
autoprint autoprint.pdf
!autoprint (use window.print()) !autoprint.pdf
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
I can reproduce this issue on Windows with nwjs-sdk-v0.21.5. But it works fine on Linux.
https://github.com/nwjs/nw.js/issues/5111