-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win.print() "copies" option no longer works. #6440
Comments
I can reproduce this issue on Linux/Windows with nwjs-sdk-v0.28.0.
|
Does it work in previous versions? Just checked with Chromium browser, |
Dear @rogerwang, thank you for taking the time to address this issue, it used to work in previous builds before Chromium team refactored the printing code. If you remember we've submitted a pull request in the past to integrate it, we even submitted a documentation pull request that you approved :-) and the "copies" option is still in the official nw.js documentation. In my opinion since Chromium's UI allows the user to specify the number of copies, it should be easy to allow this feature for the win.print API. It's already implemented in the Chromium printing API code. Thanks! |
The UI to specify copies is not always available -- it depends on the
printer you choose. Try to specify the "save as PDF" printer you will see
that. Here in my system it's not available either with some real printers.
…On Feb 8, 2018 8:01 PM, "IBS Group" ***@***.***> wrote:
Dear @rogerwang <https://github.com/rogerwang>, thank you for taking the
time to address this issue, it used to work in previous builds before
Chromium team refactored the printing code. If you remember we've submitted
a pull request in the past to integrate it, we even submitted a
documentation pull request that you approved :-) and the "copies" option is
still in the official nw.js documentation.
In my opinion since Chromium's UI allows the user to specify the number of
copies, it should be easy to allow this feature for the win.print API. It's
already implemented in the Chromium printing API code.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6440 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAKGGYv5jw5IFkW1sCTORw3Smr7htXIgks5tSuIcgaJpZM4R19vB>
.
|
@rogerwang Yes absolutely, however it's still a useful option to have :-) And it's available in lots of printers under Windows. We're building some automated printing APIs on top of nw.js and this is quite an important little tool, perhaps the Chromium API already handles this? as in even if copies is > 1 and the target printer doesn't support it, it only prints 1 copy. Can you think of a solution or alternative? I was thinking of trying to submit a pull request last time, but I am not sure if we can do it on the nw.js side only without touching Chromium, since Chromium is constantly changing. Thanks. |
I think it won't work when the printer doesn't support this option. Will it work for you if you put win.print() in a loop? |
@rogerwang Do you mean that it will crash? It's not a big deal if it doesn't print multiple copies for printers that don't support that feature, as long as it doesn't crash or something. The important thing is it will work for the printers that do support the feature, which are plenty. Unfortunately looping is not very graceful, it doesn't always work since it's a UI operation. Thanks. |
It shouldn't crash, but makes the API unreliable. Will look to fix this. |
Thank you very much @rogerwang. You are awesome. |
Dear @rogerwang Any update concerning this? Thanks! |
This is fixed in git and will be available in the next nightly build. |
Hi @rogerwang :-)
NWJS Version : 0.28.0
Operating System : Windows 8.1
Expected behavior
When settings the options object to something like {copies: 5} the printed document should contain 5 copies.
Actual behavior
Only 1 copy gets printed.
How to reproduce
Run win.print() on any open window or open PDF window.
Thanks for your help!
The text was updated successfully, but these errors were encountered: