Hi Everyone,
Can anybody tell me how to print monochrome images using Zebra printer via ZPL language
Thanks in advance.
Regards.
Printable View
Hi Everyone,
Can anybody tell me how to print monochrome images using Zebra printer via ZPL language
Thanks in advance.
Regards.
You need to run it through the image convert utility. You can either create a ZPL program to load the image data into the Zebra or make it part of your ZPL program when you're ready to print the label. When printing to the Zebra, you can't use the Windows printer if you are writing the printer commands. What I do is have my application create the ZPL program on the fly and then call ShellExecute to run my ZPL program. Hasn't failed me yet.
Here is an example of what I'm talking about. The Zebra image convert utility will take your image and create the byte representation of it. You need to use the ZPL graphics load statement ~DG. The arguments for the statement are <device>:<image name>, <number of bytes>, <bytes per row>, <data>. The information is dumped into a text file which is then sent to the Zebra via ShellExecute.
Code:CStdioFile OutputFile;
CFileException FileExc;
if ( !OutputFile.Open( "C:\\Visual\\VMfgCfg\\AMATLogo.grf", CFile::modeWrite | CFile::modeCreate, &FileExc ) )
{
FileExc.ReportError();
return;
}
OutputFile.WriteString( "~DGR:AMATLOGO,00180,005,000FFFE000\n" );
OutputFile.WriteString( "001FFFF800\n" );
OutputFile.WriteString( "000000FE00\n" );
OutputFile.WriteString( "0000000F00\n" );
OutputFile.WriteString( "0000000780\n" );
OutputFile.WriteString( "01FFFFC1C0\n" );
OutputFile.WriteString( "03FFFFF1C0\n" );
OutputFile.WriteString( "000000F8E0\n" );
OutputFile.WriteString( "0000003C60\n" );
OutputFile.WriteString( "0000001C60\n" );
OutputFile.WriteString( "3FFFFF8C70\n" );
OutputFile.WriteString( "7FFFFF8E70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E73801CE70\n" );
OutputFile.WriteString( "E71FFDCE70\n" );
OutputFile.WriteString( "E31FF9CE70\n" );
OutputFile.WriteString( "638001CE70\n" );
OutputFile.WriteString( "63C001CE70\n" );
OutputFile.WriteString( "71F001CE70\n" );
OutputFile.WriteString( "38FFC1CE70\n" );
OutputFile.WriteString( "383F81CE70\n" );
OutputFile.WriteString( "1E0001CE70\n" );
OutputFile.WriteString( "0F0001CE70\n" );
OutputFile.WriteString( "07F001CE70\n" );
OutputFile.WriteString( "03F801CE70\n" );
OutputFile.WriteString( "007001CE70\n" );
OutputFile.Close();
// Send the Applied Materials logo to the Zebra printer
::ShellExecute( NULL, "open", strCommand, "/ccopy C:\\Visual\\VMfgCfg\\AMATLogo.grf \\\\newark\\zebra105secr", NULL, SW_HIDE );
This is just some additional info:
I have just written a .net based program that prints to a Zebra TLP 2844-Z thermal label printer. I scrapped the ZPL because of the shabby appearance of barcode labels and opted for printing via the standard windows print method (the vb.net printdocument control was used). I am not sure how you would reference that in C++, but many printers support binary image data these days and its possible that you could use the same method as used to print to a standard laser printer.
To the OP, I just realized I only gave you the code that loads the graphics into the printer, not actually print it out. Sorry about that. I'll put up the actual code for printing the graphics, in a bit.