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

Bugfix for accessing network printers #16

Merged

Conversation

driehle
Copy link
Contributor

@driehle driehle commented May 27, 2019

Calling listPrinters() on Windows currently returns all printers installed, which may be either local printers or network printers. Sending documents there via print() also works withouth any problems. However, when calling printerInfo() or printerOptions() for a network printer (e.g., \\SOMEWHERE\PRINTER01), a System.Printing.PrintQueueException is thrown saying that the printer name is invalid.

This PR solves this issue by splitting up the printer name into host name and printer when it starts with \\. Then, the remote print server can be accesses with new PrintServer(host) and everything works as intended. This also solves issue #10.

@driehle driehle changed the title Bugfix for access network printers Bugfix for accessing network printers May 29, 2019
@MatteoMeil MatteoMeil merged commit 0ed32a9 into MatteoMeil:master Jun 3, 2019
MatteoMeil added a commit that referenced this pull request Jun 3, 2019
@MatteoMeil
Copy link
Owner

Thank you very much for your work!
I really appreciate these two PR.

I have not so much time to spend fixing bugs and improving my repo, so external help is always welcome and appreciate.

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

Successfully merging this pull request may close these issues.

2 participants