8 Replies Latest reply on Aug 22, 2017 12:12 PM by Robin West

    Using ^XG to print a Graphic print the graphic and a whitespace of the same length

    Bryan Sanchez

      Hi, i have a iMZ320 printer and i am trying to print a graphic with a barcode, i manage to print both fine, but i am having a white space of the same size of the label format even when i configure the label size to a specific length. No matter what length of the label i configure i always have a white space of the same length. Why i am having such white space?


      This is the code i am using:


           // ZPL Commands, configure as zpl language

           string setLanguageCommand = "\r\n! U1 setvar \"device.languages\" \"zpl\"\r\n";


           // Configure label length

           string labelLenghtCommand = "\r\n! U1 setvar \"zpl.label_length\" \"1790\"\r\n";


           // Print the label and the barcode

           string printerCommand = @"^XA^FO0,0^XGR:IMAGE.GRF^FS^FO80,1625^BY3^BCN,120,Y,N,N^FDCode123^FS^XZ";


           // Send command to printer to configure it

           byte[] responseSetLenguage = printer.Connection.SendAndWaitForResponse(Encoding.ASCII.GetBytes(setLanguageCommand), 500, 500);

           byte[] responseLabelLenghtCommand = printer.Connection.SendAndWaitForResponse(Encoding.ASCII.GetBytes(labelLenghtCommand), 500, 500);


           // Store image to print

           printer.StoreImage("R:IMAGE.GRF", resizedBitmap, 580, 1600);


           // Print image stored with ZPL Command

           byte[] responsePrinterCommand = printer.Connection.SendAndWaitForResponse(Encoding.ASCII.GetBytes(printerCommand), 500, 500);



      Archivo 8-13-17 8 52 33 PM.jpeg