Click here to Skip to main content
15,898,792 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, Greetings all, I am new at this forum.

Please help, How do I print the image (the logo) to a Zebra barcode printers Z4M Plus Generic text only driver via a USB port. The coding I have made (VB6) :

VB
Private Sub Command1_Click()
Printer.Print "^XA" & Chr(13)
Printer.Print "^SZ2" & Chr(13)
Printer.Print "^JMA" & Chr(13)
Printer.Print "^MCY" & Chr(13)
Printer.Print "^PMN" & Chr(13)
Printer.Print "^PW822" & Chr(13)
Printer.Print "~JSN" & Chr(13)
Printer.Print "^JZY" & Chr(13)
Printer.Print "^LH0,0" & Chr(13)
Printer.Print "^LRN" & Chr(13)
Printer.Print "^XZ" & Chr(13)
Printer.Print "~DGR:SSGFX000.GRF,69,3,:Z64:eJxjYG9gAKL6B0DE+B+E2P83AJH8DwYQegBF/xtA6B8DAkFE5MEIANG0GvY=:489D" & Chr(13)
Printer.Print "^XA" & Chr(13)
Printer.Print "^FO319,183" & Chr(13)
Printer.Print "^XGR:SSGFX000.GRF,1,1" & Chr(13)
Printer.Print "^FS" & Chr(13)
Printer.Print "^PQ1,0,1,Y" & Chr(13)
Printer.Print "^XZ" & Chr(13)
Printer.Print "^XA" & Chr(13)
Printer.Print "^IDR:SSGFX000.GRF" & Chr(13)
Printer.Print "^XZ" & Chr(13)
Printer.EndDoc
End Sub



However, the printout empty, Is there something wrong? Please input suggestions to solve this problem.

Thank you very much

Best Regards,
Hariyanto
Posted
Comments
Christian Graus 21-Jul-11 20:30pm    
Why are you using VB6 ? Do you hate yourself ?

You should try creating the format in a report and then select a Zebra Driver to print to.
you could try downloading the driver from Zebra.com,
Install the driver and select the USB port.
You might also want to request from Zebra the ZPL-II Programming guide or they may have it in a PDF format to download to help you write your own code
 
Share this answer
 
Here's a ZPL-II sample code of a 4"x6" shipping label it is just in plain Text
I hope it helps you format your code, The way you have your code doesn't seem like the printer will be able to interpret.

I noticed that every line ends with ^FS and your code doesn't have that.

I hope this helps you.

^XA^CFE^PR12^FS
^BY4^BCN,330,N^FO080,0070^FD>;>800007043868012259175^FS
^FO170,0430^A0N,35,35^FD(00) 0 0704386 801225917 5^FS
^FO030,0420^A0N,50,50^FD327^FS
^FO700,0420^A0N,50,50^FD Q46^FS
^FO016,470^GB800,0,6^FS
^FO022,480^AEN,25,10^FDShip From:^FS
^FO022,520^AAN,30,12^FDCUSTOMLINE ^FS
^FO022,550^AAN,30,12^FDFOR C-LIFE GROUP, LTD. ^FS
^FO022,580^AAN,30,12^FD567 MELROSE STREET ^FS
^FO022,610^AAN,30,12^FDPLACENTIA , CA 92870^FS
^FO440,480^AEN,25,10^FDShip To:^FS
^FO440,520^AEN,30,12^FDSDC-0017 ^FS
^FO440,550^AAN,30,12^FD100 GAP BLVD ^FS
^FO440,580^AAN,30,12^FD ^FS
^FO440,610^AAN,30,12^FDGALLATIN , TN 37066^FS
^FO016,640^GB800,0,6^FS
^FO022,660^AEN,25,10^FDStyle Program 691745^FS
^BY2^BCN,100,N^FO090,0700^FDHF9XI7A^FS
^FO022,820^A0N,50,50^FDPO# HF9XI7A^FS
^FO440,670^AEN,25,10^FDStyle: 009350277^FS
^FO460,710^AEN,25,10^FDSize: 0000^FS
^FO480,750^AEN,25,10^FDQTY: 8^FS
^FO430,470^GBO,390,6^FS
^FO016,860^GB800,0,6^FS
^FO030,0870^A0N,60,50^FD327^FS
^FO700,0870^A0N,60,50^FD Q46^FS
^BY4^BCN,170,N^FO080,0930^FD>;>800007043868012259175^FS
^FO120,1180^A0N,40,40^FD000070438680122^FS
^FO420,1120^A0N,120,70^FD5917^FS
^FO570,1180^A0N,40,40^FD5^FS
^XZ
 
Share this answer
 
Comments
pengeniso 21-Jul-11 23:23pm    
Hi Adam,

Thanks for your Attention. See my real coding below, Other design can print but cannot for logo. Can you show/send me coding how to print logo (Anything)? :

Public Sub Cetak()

Dim MData As String

MData = MData & "^MD25" & Chr(13)
MData = MData & "^XA" & Chr(13)
MData = MData & "^SZ2" & Chr(13)
MData = MData & "^JMA" & Chr(13)
MData = MData & "^MCY" & Chr(13)
MData = MData & "^PMN" & Chr(13)
MData = MData & "^PW942~JSN" & Chr(13)
MData = MData & "^JZY" & Chr(13)
MData = MData & "^LH0,0" & Chr(13)
MData = MData & "^LRN" & Chr(13)
MData = MData & "^XZ" & Chr(13)
MData = MData & "~DGR:SSGFX000.GRF,1869,21,:Z64:eJztlDFuxCAQRSEuKH0EjsLRsLRFjpGruEu5R4hTpcxKKWIpjifDfBgPG5cpQ2HhZ+D/P4CdG4jbHgjNcWdybpSXa4VTMvC9PL6I5ky7a1Dat8C1hzvRK9GNYezgB9HCMHXwk1dgmA2UPos74pXlc6K9zNqY+bJyLjACroCLkzl3kJOK4lZgEWcwhwaLvSIeDnFaYxU3gejGI0pyG4iWAEcVPslzHpC8pkxa4SKOlMi3lxGrwhlLKsQQQiWyRmfosZYnWBJIXtMJHBqcWxCk5I28AMYK+eMj0bPZBCkiBTkKU3XSQYhi37jcrPUikDtvdbc2gTtEL+KNTwn8QxxlwgYjHc9yNfx/+8tWD2RrD2cwTCdwnE9gWk4g3vrdG3Bjcgdx9e5gxEHrYWpH0sIMmDpIMJNwGVWnnjQD20WIcKbiv2G7CCPsqo6c5GCgb3CAMzW/1a8dXOs6i4W3qngKTZXbiGRhE7A5B5RTd0BaaAO8cT8aOB2wFdfAqPaMfNZ0xxyzvEqyEXXn1VMwOXJTiqYMqfXT4UMXtdnKiGpjNjDgLdmBrI8/af+fSdjsqYPFtbfnpzokUxf3AxeieY0=:496F" & Chr(13)
MData = MData & "^XA" & Chr(13)
MData = MData & "^FO5,28" & Chr(13)
MData = MData & "^GB888,302,3" & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FO244,30" & Chr(13)
MData = MData & "^GB0,299,3" & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FO6,130" & Chr(13)
MData = MData & "^GB239,0,3" & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FO6,238" & Chr(13)
MData = MData & "^GB239,0,3" & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT15,69" & Chr(13)
MData = MData & "^CI0" & Chr(13)
MData = MData & "^A0N,25,34" & Chr(13)
MData = MData & "^FD" & Left(rs!DESCRIPTION_1, 14) & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT15,105" & Chr(13)
MData = MData & "^A0N,25,34" & Chr(13)
MData = MData & "^FD" & Mid(rs!DESCRIPTION_1, 15, 14) & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT15,165" & Chr(13)
MData = MData & "^A0N,25,34" & Chr(13)
MData = MData & "^FD" & Left(rs!LOCATION, 12) & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT15,213" & Chr(13)
MData = MData & "^A0N,25,34" & Chr(13)
MData = MData & "^FD" & Mid(rs!LOCATION, 13, 12) & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT15,273" & Chr(13)
MData = MData & "^A0N,25,34" & Chr(13)
MData = MData & "^FD" & Format(rs!DATE_PLACED_IN_SERVICE, "dd-MMM-yyyy") & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT15,309" & Chr(13)
MData = MData & "^A0N,25,34" & Chr(13)
MData = MData & "^FD" & Format(rs!DATE_PLACED_IN_SERVICE, "dd-MMM-yyyy") & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FO267,180" & Chr(13)
MData = MData & "^BY3" & Chr(13)
MData = MData & "^BCN,92,N,N" & Chr(13)
MData = MData & "^FD" & rs!Asset_Number & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT395,303" & Chr(13)
MData = MData & "^A0N,30,41" & Chr(13)
MData = MData & "^FD" & rs!Asset_Number & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT267,84" & Chr(13)
MData = MData & "^A0N,42,58" & Chr(13)
MData = MData & "^FD" & rs!BOOK_TYPE_CODE & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FT267,165" & Chr(13)
MData = MData & "^A0N,25,34" & Chr(13)
MData = MData & "^FD" & Left(rs!Description, 40) & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^FO709,50" & Chr(13)
MData = MData & "^XGR:SSGFX000.GRF,1,1" & Chr(13)
MData = MData & "^FS" & Chr(13)
MData = MData & "^PQ1,0,1,Y" & Chr(13)
MData = MData & "^XZ" & Chr(13)
MData = MData & "^XA" & Chr(13)
MData = MData & "^IDR:SSGFX000.GRF" & Chr(13)
MData = MData & "^XZ" & Chr(13)

Printer.Print MData
Printer.EndDoc

End Sub


Thanks again Adam,

Regards,
Hariyanto
Here's a ZPL-II code that prints a Logo,
Compare this code with yours and maybe you will be able to correct your code,
I printed the sample sending the file directly to the printer and it did print
perfectly. I used Bar Tender Labeling software by Seagull Scientific to create
the Design using a Zebra Printer (300) DPI and then Printed to a file to get the code, so the conversion of the graphics was handled by the software.

I hope this will lead you to better results.

Regards.

^XA
^SZ2^JMA
^MCY^PMN
^PW897~JSN
^JZY
^LH0,0^LRN
^XZ
~DGR:SSGFX000.GRF,11286,38,:Z64:eJyNmj3O7DQUhh1FYqiYDSDCMigQ2QpLYAGIRKKgZAewFe+AJZArClrTuQgxsc+/f/Lh4s58k+far18f28eecc6WLaXoPiprusv5AbSkUq5nKmEJT9BGVHqAZoaeerAKlfYRNCloXNlbU8PKtvQ/KnsZaOTZaql+k1MF9Zuca6rb5Lumuk1uDdVpsmmw2+SrpTpNLh2qbbIDtU32GmyjrPUhF19Ra5eqA3vrUtVkagaxK78vvnasLz6l40NPc7G+9sXX8geQ9XXQxUr+qItW/ki8dX8k3sofQtr9sXgtfyxeB89ofHKRTi4PlHRysw+iM3/0u3iZycmdrLq4W6VE2Wl9ViKok8WIa1VV6cqok+WTsBodooI6uZSKF/shVc2dXEsVS6cBTW3l/WLFcpNkBVTx5o6/kumlonakIvzt1bDtXPdFQgI8jipQPJsaqVMHeHwpYZ5NPWkwd6mThB2KmknqSj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diNqhRvYxVUMLWw0LWhQkP17t49Uxz2jz/a4inURodK4mbuTmOrSs8kyercvUuRT2rqUNTGn2xD8U7tletQFtm0u8YK81smmSyVFVoWPlPdpeI1Rb/QaDqpIaih/olMLd45UbpoqjorbfxR/wZKDDtUR3qyoJ1DJPZlcWbijPtHRb1EhAhrfnY3i4hp2GB+xP+THWvPjM0u2PawVMDDz4l0S63t9NxbajGHhp4NIEZ9uvTby4Z5/efgF67z+MeqqkxPv4+V8tOHxH/rSPEz:C15A
^XA
^FT45,280
^CI0
^A0N,38,52^FDTHIS IS A TEST^FS
^FT19,375
^A0N,38,43^FDPRINTING GRAPHICS.^FS
^FO53,421
^XGR:SSGFX000.GRF,1,1^FS
^PQ1,0,1,Y
^XZ
^XA
^IDR:SSGFX000.GRF^XZ
 
Share this answer
 
Hi Adam,
Thanks n Sorry before,
I've tried again using the Generic Text Only printer driver with a USB port, the logo is still unprinted, where lies the harm in my code - confused. If using a Zebra Z4M driver with a USB port, how to write code in VB6?. Is there a simple example that I can get - please help Adam.

Thank You very much,-

Best Regards,
Hariyanto
 
Share this answer
 
I don't know how you generated the logo code,
try Cutting and pasting the Logo code that I sent you with your code and see if that works (take a look at all the code my logo generated all the code after ~DGR:SSGFX000.GRF).

Then the code below prints it.
^XGR:SSGFX000.GRF,1,1^FS

What does your Logo looks like?

Regards
 
Share this answer
 
v2
Hi Adam, Sorry if my response very long, because i am field workers,he3 . . .

i create logo using bartender 8.1 then print to file.

Hmmm .. . OK, I will try AGAIN with simple or small logo (Anything). I will send progress to you about it

Thanks very much Adam,

Best regards,
Hariyanto
 
Share this answer
 
Hi Adam,

Finally, I use other methods to send and store logos in the printer, then when printing templates called the logo and Solved.

Thanks for your suggestions and participation. . .

Best Regards,

Hariyanto
 
Share this answer
 
Comments
srinu.gatla 23-Feb-15 1:36am    
Hi I am trying to print the barcode using ZPL command by following the same approach "Generic/Text only" but it is printing empty label and also it is working in IE only.

Can any one please help me to print a barcode using ZPL commands to ZPL printer from browser.
SQL
Hi I am trying to print the barcode using ZPL command by following the same approach "Generic/Text only" but it is printing empty label and also it is working in IE only.

Can any one please help me to print a barcode using ZPL commands to ZPL printer from browser.


please find the sample code snippet here under

XML
<div id="raw">
        <pre>
^XA^CFE^PR12^FS
^BY2^BCN,100,N^FO090,0100^FDHF9XI7A^FS
^XZ
</pre>
    </div>
    <input onclick="varitext()" type="button" value="Print" />



Script

C#
function varitext(text) {
    text = document.getElementById('raw');
    print(text.textContent)
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900