electron
electron copied to clipboard
[Bug]: pageSize not work when silent print on windows 10
Preflight Checklist
- [X] I have read the Contributing Guidelines for this project.
- [X] I agree to follow the Code of Conduct that this project adheres to.
- [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Electron Version
16.0.0-beta.6
What operating system are you using?
Windows
Operating System Version
windows 10
What arch are you using?
x64
Last Known Working Electron version
none
Expected Behavior
pageSize works when silent print.
Actual Behavior
webContents.print({silent:true, pageSize: 'A5'})
pageSize not works when silent print. it always use printer default pageSize.
#29532 #29334 #31489
other print options has been fixed, except pageSize.
Testcase Gist URL
No response
Additional Information
No response
header
also doesn't work. See comment here
Tested on both 15.x
and 16.x
. I cannot reproduce this. It works perfectly fine for me. I suggest providing a reproducible Gist.
Test Gist: https://gist.github.com/sunchanglong/7c307aeb031e823ed8273ae44e861d45
My printer support both A4, A5 papers.
- Print options pageSize: 'A5'
- System printer default pageSize 'A4'
- Expect print with A5 papers. Result in A4 print, don't honor electron print options pageSize.
Print task queue
I have test in chrome with a5 print using the same printer, it works.
@sunchanglong I tried your Gist with Adobe PDF
and the output dimensions are correct. Can you try the same or with Microsoft Print to PDF
? It would narrow the issue down to physical device interfaces.
@m4heshd I tried to print with Microsoft Print to PDF
and the output dimensions are correct too.
When print to physical device, Notice the system print task queue, the print properties is not same with specified in code.
Ah. Then this definitely is an issue which needs to be addressed.
Just tested this and can confirm. These settings are being completely ignored when printed to non-emulated devices. @codebytere, @nornagon can we get some assistance on this? Printing is such a vital task for a majority of Electron apps. I truly hope this can be addressed soon because since #31489 I've written thousands of lines of code around this whole functionality without the knowledge of this being an issue.
Hello @codebytere , same issue on Linux. Also custom page sizes like "62X1" for pos printers for example are not supported.
Any update on this issue? It's ~insanely difficult~ impossible to replace this functionality with third-party libraries.
I think this is related to the print driver(all the ones with the red lines are affected). It doesn't seem like there is any way to workaround the issue currently.
Hedwig188
Did you test this on chrome browser?Chrome seems works right.
Hedwig188
Did you test this on chrome browser?Chrome seems works right.
Yes, I've also confirmed paper size is correctly being respected in Chrome when printing to those affected printers.
Kyocera FS-CS3500DN KX
driver is also broken.
hello @codebytere, is there any timeline on this issue? thanks.
#22066 #22014 #33190 #29532 All above are printing pageSize bugs. pageSize bug makes printing in electron nearly not work. @codebytere hopes this would be solved.
Hello, Is it in the plan?
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!
Is there a plan to fix this issue?
Is there a plan to fix this issue?
It's not work in electron 22.0.0(windows 10)
@codebytere, @ckerr, @nornagon can one of you please look into this issue? I don't get why this is being ignored for such a long period of time. This issue was there since forever and it's undeniably a most needed feature for desktop applications.
Is there a plan to fix this issue?
Is there a plan to fix this issue?
Bump
I have specified the paper size using parameters.
But the parameter does not take effect on the printing device.
I've noticed that this problem has persisted for a very long time. The print function is a common function. There are so many places where this functionality is needed, so it's very important to us.
Hope to fix it soon
It is unbelievable that a problem lasted so long. Neither was fixed.
@codebytere, Yes, you're gonna get pinged constantly because you're assigned to this issue. So pinging you again, can we get this fixed because it works completely fine on Chromium. This is not a small issue. Electron apps are made for desktop and a lot of those desktop tasks require printing. How this issue gets ignored is beyond my imagination.
It's hard to believe that this issue has not been fixed since version 8.x
It's still a problem on some printers. Can't silent print perform the same set of paper sizes as non-silent print?