How to get printer status

greeshma

Member
Hi All,
I am trying to do a bulk print to Zeebra card printers. I have written a DLL to set font and size.

There is hardware issue with that printer and it will return error "Magnetic encoding error".
This error cames after printing 20 cards, so 21st card will be blank and from 22nd card will print fine.

Is there a way to capture this harware issue and resend the print command in progress.
A code that will send print request, wait to complete it, if errors then retry.

OpenEdge 10.2B is using.
 

Osborne

Active Member
I don't know if this is any help, but one possible option may be to use the System.Printing options of .NET to see if any of the available options can pickup the error. This is a simple example - System.Printing.dll needs to be added to assemblies - to check if the printer is in error:
Code:
DEFINE VARIABLE printQueue AS System.Printing.PrintQueue NO-UNDO.

printQueue = System.Printing.LocalPrintServer:GetDefaultPrintQueue().
MESSAGE "Printer Error?" printQueue:IsInError VIEW-AS ALERT-BOX INFORMATION.
If no joy with the print queue, there are various options using PrintSystemJobInfo - msdn.microsoft.com/en-us/library/system.printing.printsystemjobinfo.aspx - that may help.
 

greeshma

Member
I don't know if this is any help, but one possible option may be to use the System.Printing options of .NET to see if any of the available options can pickup the error. This is a simple example - System.Printing.dll needs to be added to assemblies - to check if the printer is in error:
Code:
DEFINE VARIABLE printQueue AS System.Printing.PrintQueue NO-UNDO.

printQueue = System.Printing.LocalPrintServer:GetDefaultPrintQueue().
MESSAGE "Printer Error?" printQueue:IsInError VIEW-AS ALERT-BOX INFORMATION.
If no joy with the print queue, there are various options using PrintSystemJobInfo - msdn.microsoft.com/en-us/library/system.printing.printsystemjobinfo.aspx - that may help.
Thanks , I will try this method :)
 
Top