Skip to content
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

Default printer changed after printing #5300

Closed
petermeester opened this issue Sep 13, 2016 · 7 comments
Closed

Default printer changed after printing #5300

petermeester opened this issue Sep 13, 2016 · 7 comments
Assignees

Comments

@petermeester
Copy link

Hi, the new printing feature is awesome . We are using it in our application. We developed an application for our delivery partners (restaurants) so they can receive orders from our website which will be automatically printed. Works fine. We can't push multiple printjobs at once because we first create a local PDF file received from our API but we have settle this using a custom function which check every five seconds for new printjobs and execute one printjob at a time (some kind of print queue).

In our application the client can choose a normal A4 printer and a POS printer. We noticed that when a printjob is executed, the default printer on Windows has been changed. Is this a bug in Chromium? When we execute the print function, we define the printer name, so we don't use the default printer. Is there a way to get the default printer and set the default printer back again after the printjob has been executed?

NWjs version: nwjs-sdk-v0.17.0-win-x64
OS version: Windows10

@rogerwang
Copy link
Member

Should be a bug in NW. Will fix it.

@rogerwang rogerwang self-assigned this Sep 18, 2016
@petermeester
Copy link
Author

Hi @rogerwang,

I just tested it again with nwjs-sdk-v0.19.3-win-x64 and it appears to be solved.
Is that right, did you solved this? If so, this issue can be closed.

@rogerwang
Copy link
Member

rogerwang commented Dec 28, 2016 via email

@petermeester
Copy link
Author

Thnx, I will close this issue.

@murrah
Copy link

murrah commented Mar 20, 2018

Hi.

Thanks so much for this print API. It has allowed me to completely ditch iText on the backend. Cool!

However, I think this might still be a bug.
nw.js SDK v0.28.3, Win64

I print the current window html to a pdf as below. If I then do a win.print() to open the "normal" print dialog box the default printer has been set to "Save as PDF". I am happy to reinstate the original printer but could not find a way to get it before I save as pdf, nor reinstate the default.

win.print({
	pdf_path: me.pdfDestinationFile, 
	headerFooterEnabled: false
});

If I subsequently do this to open a (non nw.js) window, the chrome print dialog opens as it should but the printer is set to "Save as PDF"

var win = window.open();
win.print();  

If I set it to a printer then close and re-open it stays set to the printer. And, if I then run the above print to pdf code the default reverts to "Save as PDF".

Any ideas? Is it possible to find out the current printer and re-select it afterwards?

Thanks so much,
Murray

@rogerwang
Copy link
Member

@murrah could you please submit a new issue for this? Thanks.

@murrah
Copy link

murrah commented Mar 20, 2018

Sure. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants