Printing images through Intranet (C#) to Zebra printer

D David Gauthier 3 years 7 months ago
504 1 0

Hi,
I have read tons of discussion threads but could not find a way to print graphics on our Zebra Printer.
I am coding in C# and trying to print label with dynamic graphics (i.e. each product as their own SVG image (drawing) that needs to be printed on a label).
 
Our first attemps focussed on converting the SVG on our server side to a ZPL formatted representation and then print the whole ZPL command, along with the converted SVG picture. All my efforts remained unsuccesful. After reading many posts, I then assumed that downloading the graphic to the printer first and then recall it would be a better way to print our labels. The label prints but no image is visible. In addition, if I print Graphic content on the printer, I do not believe that graphic has been downloaded at all. Here is the C# code:
 
string zplImageData = string.Empty;
byte[] binaryData = System.IO.File.ReadAllBytes(@Server.MapPath("Temp/abcd.png"));
 
foreach (Byte b in binaryData)
        {
            string hexRep = String.Format("{0:X}", b);
            if (hexRep.Length == 1)
                hexRep = "0" + hexRep;
            zplImageData += hexRep;
        }
 
string s = @"^XA^MNY~DYE:COMPOUND.PNG,P,P," + binaryData.Length + ",," + zplImageData + @"^XZ^FO28,260^IME:COMPOUND.PNG^FS^XZ";
RawPrinterHelper.SendStringToPrinter(@"\\info-0004\ZDesigner 105SL 203DPI Zebra", s);
 
I am stuck at this point and really need to find a solution. I need your help !
 
In addition, I will end up needing to insert to different graphics on the label.
 
Thanks in advance
 
David

Please Register or Login to post a reply

1 Replies

D David Gauthier

I forgot to mention: I am printing on a 105SL printer

David

CONTACT
Can’t find what you’re looking for?