cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PB 9 , windows 7 Has anyone written code to print label with zebra printer?

sabafz
Discoverer
0 Likes
234

How to convert the below code to Zebra printer? Do I need to learn ZPL programming? And make a new label with .zpl extension?

I can print a test label directly from the zebra ZDesigner GX430t printer. 

I now need to print label through the code PB9 and Windows 7.

The current code to print name and class label for Dymo printer is as below:

if NOT IsValid(dymo) then
dymo = CREATE oleobject
end if

if NOT IsValid(dymoLabel) then
dymoLabel = CREATE oleobject
end if

li_dymo_ole_connect = dymo.ConnectToNewObject("Dymo.DymoAddIn")

li_dymolabel_ole_connect = dymoLabel.ConnectToNewObject("Dymo.DymoLabels")

if IsNull(li_dymo_ole_connect) then li_dymo_ole_connect = -999

// make sure the object is valid before accessing it
if IsValid(dymo) AND IsValid(dymoLabel) then

if (li_dymo_ole_connect = 0) AND (li_dymolabel_ole_connect = 0) then

TRY

dymo.StartPrintJob();

if (tab_1.tabpage_signup.rb_barcode.Checked) then
        lb_open = dymo.Open2(GetCurrentDirectory() + "\Checkpoint_HSV5_sigps.label")

      dymoLabel.SetField("RIDER NUMBER", ls_racer_id);
     dymoLabel.SetField("RIDER NAME AND CLASS", ls_full_name);

 

thanks,

Saba

Accepted Solutions (0)

Answers (1)

Answers (1)

BruceAArmstrong
Discoverer
0 Likes

You can't "convert" that code.  That code is specific to an ActiveX that Dymo made available for it's printers.  What you need to do is send ZPL commands directly to the printer.  You might see this thread in the Appeon forums where that is discussed:  https://community.appeon.com/qna/q-a/powerbuilder-run-command