How do I release the printer handle for the Zebra ZXP Series 3?

I am using the Zebra Technologies - Card ID Printing – Zebra Card SDK for ZXP Series 3 Printers – C# .

 

How can I release the printer handle so that I can print another card while my application is open?? I am havnig to close my application and re-open it every time.. WHY?

 

I tried RefreshConnectionToPrinter()

 

but that didn't work.

 

rwest

Stephen Troup
Provided the job is being

Provided the job is being closed at the end it should release the printer.

i.e. the code j.Close(); where j is the open zmotifprinterlib.Job object

If you try to open another job while the existing is still connected will result in an error with the ZXP3.

I tend to use one job for each print rather then open one job for every print. So on closing the job you'll need to open another - you can't use the old reference as it's now closed even if it's not nothing.

i.e. a typical loop will do the following    open job, connect to printer, print card, close job

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Joshua Preston
I am using Zebra Technologies

I am using Zebra Technologies - Card ID Printing – Zebra Card SDK for ZXP Series 3 Printers – C# , so I'm not sure if i have the zmotifprintlib. I do think I found the issue though, thanks to your help. I was not setting

ZBRGraphics graphics = null;

I was instead doing

ZBRGraphics graphics = new ZBRGraphics()

which may have been why? I'm going to test it and find out

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Joshua Preston
I finally figured it out. I

I finally figured it out. I was forgetting to do

            // Starts the printing process and releases the Graphics Buffer

            if (graphics.CloseGraphics(out errorValue) == 0)

            {

                errorMessages += "Printing CloseGraphics Error: " + errorValue.ToString();

            }

​thus the handle was never being released until the application exited

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments