If my USB receipt printer is not Plugged in when a print job is sent, the job is sent out into the unknown ... and lost forever .... with out any sort of error....
A little testing and playing around i found that if i manually set the "Use Printer Offline" Check .. all print jobs are queued, and wait for the printer to come back online.. If i clear the Check while the printer is still not available, Again all the jobs are sent out into the unknown...
NOW .... The decision is to check if the Printer is Available, and if not to prompt the user to make it available or cancel the print ...
However digging through all the printer object's i'm still to find the correct property's to check this..
Help !!! where do i check if a specified printer is available... (IE. Plugged in and switched on)..
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
I have 3 printers setup according to what network i'm attached to ..
Brother = Office Network
HP LaserJet = Home Network
HP DeskJet = Clients Network
And the Epson is the USB One. (above result = USB cable out)..
However, of the three printers that are connected to 3 Very different Networks, it shows that all three are available to print too.. With the reciept printer i cant take the chance that the receipt printer might be networked (two (or more) units sharing a Printer), and this code snip Fails when it comes to Networked printers..
Surprisingly this code snip is Found 19 times in google, on different forums, even on a thread asking about networked printer status..
I need to be able to get info like what the control panel has IE..
Here you can see that 3 printer objects are "Ready", One is "Not Avail" , and two are essentially unknown ..
After plugging in the USB printer is becomes ready..
I'm still looking into the WMI code to see if i can find something else that will return correct results, however WMI.PrinterStatus is not quite good enough..
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
1) There are definately issues with any networked printer, and even after years of searching I have not found any approach that is universally reliable.
2) Even if you can detect with 100% reliability the ability of a printer to accept a print job, this does NOT mean that a (usable) printout will be generated. The best you can get is a "probability".
For critical items (eg reciepts), this has caused me to generate a sub-system that does pre-printer queuing and caching. This was definately non-trivial as it requires a means of storing the information necessary to generate the prinout, but the benfits were amazing.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!) 2008, 2009 In theory, there is no difference between theory and paractice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Bookmarks