|
-
August 7th, 2009, 07:03 AM
#1
How to print graphics in ZPL
Hi Everyone,
Can anybody tell me how to print monochrome images using Zebra printer via ZPL language
Thanks in advance.
Regards.
-
August 10th, 2009, 03:18 AM
#2
Re: How to print graphics in ZPL
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.
-
August 10th, 2009, 08:46 PM
#3
Re: How to print graphics in ZPL
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 );
-
August 11th, 2009, 09:21 AM
#4
Re: How to print graphics in ZPL
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.
-
August 11th, 2009, 05:59 PM
#5
Re: How to print graphics in ZPL
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.
-
August 11th, 2009, 06:03 PM
#6
Re: How to print graphics in ZPL
 Originally Posted by MikkyThomeon
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.
Yeah, I'm not sure why he wasn't trying to use PrintDocument. Although, I have no problem with ZPL.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|