0 Replies Latest reply on Jul 24, 2018 7:04 AM by Greg Foote

    EPL Raw Image Data for printing a label

    Greg Foote

      When building a string for sending to the printer RAW what encoding for the bytes of gif file should I use to convert to so that the printer understands what I am sending correctly ?

       

      The target printer is a LP 2824

       

      Here is the EPL we are trying to send:

       

      Here is the QR Code image:

       

      frame.png

       

       

      StringBuilder label = new StringBuilder();

                  label.AppendLine("I8,A,001");

                  label.AppendLine();

                  label.AppendLine();

                  label.AppendLine("Q204,024");

                  label.AppendLine("q448");

                  label.AppendLine("rN");

                  label.AppendLine("S4");

                  label.AppendLine("D7");

                  label.AppendLine("ZT");

                  label.AppendLine("JF");

                  label.AppendLine("O");

                  label.AppendLine("R21,0");

                  label.AppendLine("f100");

                  label.AppendLine("N");

       

       

                  // QR Code

                  var qrCode = "GW280,78,15,116,";

       

       

                  var filePath = @"C:\Users\Greg\Downloads\Frame.png";

                  byte[] bytes = new byte[1024];

                  File.OpenRead(filePath).Read(bytes, 0, 1024);

       

       

                  System.Drawing.Image image = System.Drawing.Image.FromFile(filePath);

                  var rawBinaryString = ByteArrayToString(ConvertToRawBinary(image));

       

                 qrCode += rawBinaryString;

                  label.AppendLine(qrCode);

       

       

      // Time of printing

                  var timeLine = "A388,53,2,3,1,1,N,";

                  timeLine += "\"" + DateTime.Now.ToShortTimeString() + " - " + DateTime.Now.ToShortDateString() + "\"";

       

       

                  label.AppendLine(timeLine);

       

                  // Product Short Name

                  var shortName = "A264,183,2,4,1,1,N,";

                  shortName += "\"ORing - 22MM\"";

       

                  label.AppendLine(shortName);

       

                  // Serial #

                  var serialNum = "A262,119,2,1,1,1,N,";

                  serialNum += "\"GHG6547324KL990656\"";

       

                  label.AppendLine(serialNum);

       

                  var labelToPrint = label.ToString();

                  labelToPrint += "P1\n";

       

                 // Send a printer-specific to the printer.

                  RawPrinterHelper.SendStringToPrinter("zebra", labelToPrint);

       

       

      This ends up sending this string to the printer:

       

       

      I8,A,001

       

       

       

       

      Q204,024

      q448

      rN

      S4

      D7

      ZT

      JF

      O

      R21,0

      f100

      N

      GW280,78,15,116,89504e470d0a1a0a0000000d4948445200000064000000640802000000ff800203000000017352474200aece1ce90000000467414d410000b18f0bfc610500000006624b474400ff00ff00ffa0bda7930000074749444154785eedd0c18e24d7110441feff4f4b80b71d04049428d6f62cf7403b7a64bd1ecc5f3fe13fff431ae6489186f9e434d29fcfdf1b699823451ae693d3487f3e7f6fa4618e1469984f4e23fdf9fcbd91863952a4613e398df473fcce2b9e881469984f4e87f9e434d22b9e58f6573c1129d2309f9c0ef3c969a4573cb1ecaf782252a4613e391de693d348af7862d95ff144a448c37c723acc27a7915ef1c4b2473a398d142952a493d34827a79122458a74721a69d9239d9c468a1429d2c969a493d3489122453a398db4ec914e4e23458a14e9e434d2c969a44891229d9c465af64827a79122458a74721ae9e43452a448914e4e232d7ba493d348911ef359a44891220d73a448914e4e232d7ba493d348911ef359a44891220d73a448914e4e232d7ba493d348911ef359a44891220d73a448914e4e232d7ba493d348911ef359a44891220d73a448914e4e232d7ba493d348914e4e7f99e7863952a493d348cb1ee9e43452a493d35fe6b9618e14e9e434d2b2473a398d14e9e4f497796e9823453a398db4ec914e4e23453a39fd659e1be648914e4e232dfb2b9e881429d2c9e930478a34cc915ef1c4b2bfe2894891229d9c0e73a448c31ce9154f2cfb2b9e881429d2c9e930478a34cc915ef1c4b2bfe2894891229d9c0e73a448c31ce9154ffc1cbf132952a4489122458a142952a43f9fbf3752a4489122458a142952a4487f3e7f6fa4489122458a142952a44891fe7cfede489122458a142952a44891227d97b77f8c9f79c5139122458af463fefd67fd0dfffeb3fe867fff597fc3fffd01bf7f721a2952a493d3611ee6488ff96c986f6e87f9e43452a44827a7c33ccc911ef3d930dfdc0ef3c969a448914e4e877998233de6b361beb91de693d34891229d9c0ef330477acc67c37c737b721ae9154f3ce6b348911ef359a448912245caa31ff65da4573cf198cf22457acc679122458a14298f7ed877915ef1c4633e8b14e9319f458a142952a43cfa61df457ac5138ff92c52a4c77c162952a44891f27f8fbec5d391863952a4613e398d1429d273be8bf4559e8e34cc91220df3c969a448919ef35da4aff274a4618e1469984f4e23458af49cef227d95a7230d73a448c37c721a2952a4e77cf7559e1ee6573c112952a493d348c3bcec5fe5e9617ec5139122453a398d34cccbfe559e1ee6573c112952a493d348c3bcec5fe5e9617ec5139122453a398d34cccff92e52a448c3fcdbf9f9611ee6618e74731b2952a461feedfcfc300ff33047bab98d1429d230ff767e7e9887799823dddc468a1469987f3b3f3fccc33ccc9196fde4749823458a74727a723accc31c2952a493d30fede4749823458a74727a723accc31c2952a493d30fede4749823458a74727a723accc31c2952a493d30fede4749823458a74727a723accc31c2952a493d30f2d52a44891220d73a448c33ccc8ff9ece434d273be8b142952a448c31c29d2300ff3633e3b398df49cef22458a1429d230478a34ccc3fc98cf4e4e233de7bb489122458a34cc91220df3303fe6b393d348cff96e988779985ff144a4618e34cc5fe5e90f6d988779985ff144a4618e34cc5fe5e90f6d988779985ff144a4618e34cc5fe5e90f6d988779985ff144a4618e34cc5fe5e90fede4f4e43452a493d348912245fa2a4f475af693d393d348914e4e23458a14e9ab3c1d69d94f4e4f4e23453a398d142952a4aff274a4653f393d398d14e9e43452a44891becad3913eb41fe367863952a4618e1429d2c969a44891227d683fc6cf0c73a448c31c2952a493d348912245fad07e8c9f19e64891863952a44827a79122458af4a1fd183f33cc91220d73a448914e4e23458a14e9e7f89d618e14699887799823458a1429d2efe7f7873952a4611ee6618e142952a448bf9fdf1fe64891867998873952a4489122fd7e7e7f9823451ae6611ee6489122458af49cef5ef144a4611ee6617ecc6727a791863952a40fed154f441ae6611ee6c77c76721a69982345fad05ef144a4611ee6617ecc6727a791863952a40fed154f441ae6611ee6c77c76721a69982345fad0229d9c468a142952a493d361fe317e66983fb44827a79122458a14e9e474987f8c9f19e60f2dd2c969a4489122453a391de61fe36786f9438b74721a2952a448914e4e87f9c7f89961fed0229d9c468a146998230d73a44827a727a727a7cb1ee9e43452a448c31c699823453a393d393d395df64827a79122451ae648c31c29d2c9e9c9e9c9e9b2473a398d1429d230471ae648914e4e4f4e4f4e973dd2c969a4489122451ae64827a7c33ccc91220df3b2473a398d142952a448c31ce9e47498873952a4615ef64827a79122458a146998239d9c0ef330478a34cccb1ee9e43452a44891220d73a493d3611ee648918679d95ff144a4573c11699823458a1429d2633e5bf6573c11e9154f441ae6489122458af498cf96fd154f447ac51391863952a44891223de6b3657fc513915ef144a4618e142952a4488ff9ece7f89d5fe6b9618e1469982345fa67f95b7e99e7863952a4618e14e99fe56ff9659e1be64891863952a47f96bfe597796e9823451ae648911efaebafff025356fa19fe2fc4610000000049454e44ae426082

      A388,53,2,3,1,1,N,"8:56 AM - 7/24/2018"

      A264,183,2,4,1,1,N,"ORing - 22MM"

      A262,119,2,1,1,1,N,"GHG6547324KL990656"

      P1

       

       

      But this results in a QRCode that does not resemble the actual image

       

       

      Thanks !!