how to lookup network printers

I'm not looking to get printers that are installed on the local system, I'm looking at finding printers within the network. I've tried the following:

AttributeSet aset = new HashAttributeSet();
aset.add(new PrinterName("\\\\PRINT_SERVER\\PRINTER_NAME", null));
PrintService service[] = PrintServiceLookup.lookupPrintServices(null, aset);

But this only gets me the local printers isntalled on the machine that the code is running on. What i'm looking for is to get other network printers, by name, from across the network.

Any help would be greatly appreciated.
jonnypc123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Try passing null for both parameters
0
jonnypc123Author Commented:
passing null for both parameters will just bring you back a listing of all seen printers installed on the server running the code.  I'm looking to get access to printers across the network through code without having to add the printers to the local machine first.  As there are a number of printers at multiple locations throughout the network.
0
CEHJCommented:
Have you tried using attribute PrinterURI ?
0
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

jonnypc123Author Commented:
Could you give me an example of the PrinterURI with the code example I provided?
0
CEHJCommented:
Personally i've never constructed one, but this might help

http://svn.chrilly.net/java/classpath-0.97.2/src/gnu/javax/print/ipp/IppPrintService.java
0
jonnypc123Author Commented:

Do you know where you to download and install the gnu package they are using within the source code you sent?
0
Mick BarryJava DeveloperCommented:
> Personally i've never constructed one, but this might help

then why would you think it would work???
0
Mick BarryJava DeveloperCommented:
java doesn't provide a standard way to discover all network printers.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
You might be better off trying a different approach with discovery, such as something Active Directory based, since it looks like you have a Windows network
0
jonnypc123Author Commented:
mainly it's windows based but the server the code is on is linux and being built in java.   I'm finding that java doesn't provide a standard way to discover all network printers but is there 3rd party packages i could install that would help out with this process?    I also read somewhere where someone used that IppPrintService and it worked for them, so I'm at least going to give it a shot
0
Mick BarryJava DeveloperCommented:
no it doesn't as I mentioned above. you can use 3rd party stuff but it depends on the protocol that the printers are being shared with. for example the gnu code for ipp

0
CEHJCommented:
If you have various OSs it's going to be more difficult still. You could perhaps look for services running on the IPP port (631). That would take care of the Linux networks
0
Mick BarryJava DeveloperCommented:
> If you have various OSs it's going to be more difficult still.

why?

> You could perhaps look for services running on the IPP port (631).

how will that help?
0
CEHJCommented:
There's an old API on Sourceforge called 'jipsi' for IPP. It works for me for discovering IPP services
0
Kevin CrossChief Technology OfficerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.