Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PrintDocument.PrinterSettings.PrinterName \\servername\printername Not Available

Tags:

c#

printing

I'm using the C# System.Drawing.Printing namespace. I need to send a document to a network printer; however, all of our network printers are named like this:

r99p-printername.company.com

Setting the printer name of my PrintDocument object, according to the MSDN documentation, I need to use \\servername\printername. My network admin assures me that none of the printers have this, and I can only use the above-mentioned naming convention for network printers. When I try using this in my app, I get a "Settings to access printer not valid".

Any ideas?

Thanks.

like image 528
Aaron Avatar asked Apr 12 '11 16:04

Aaron


1 Answers

If you installed the printer as a local tcp/ip printer (like this) then you should be able to call the printer whatever you want and use this printer name. I would recommend doing it this way.

If it's a shared network printer that is attached to the PC via USB, serial or parallel port then this is where you would need to share it and access it via \servername\printername. Please also keep in mind that the printer has to be installed on the computer you intend to use it. Just because it's a shared printer doesn't mean you can use it via \servername\printername without first installing it.

like image 105
Cole W Avatar answered Nov 13 '22 13:11

Cole W