Image (PCX) for EPL2 Zebra printer

I'm having problems creating and loading graphics on an EPL2 printer.

Tired of literally any available software and bullying on the Internet, I’m at a loss.

I have a 1-bit file that I am trying to download with the following script ..

setppi.txt

GK"NAMEPCX"
GK"NAMEPCX" 
GM"NAMEPCX"3042

and then download using

copy setppi.txt+ppirmt.pcx lpt1/b

Anyone with experience got any tips before I rip apart the remaining hair? I am pretty sure that this problem is related to creating pcx, but having tried all the options, I'm not sure about my next step.

+1
source share
4 answers

Here is how I found to create PCX correctly:

gimp 1- (-) BMP. PCX, 1- PCX, !

imagemagick BMP PCX.

, , , , - , , .

+3

, .

# ( .NET ), EPL:
EPL2 GW Zebra

, EPL Zebra #.

+2

PCX EPL2. - , :

GK"namepcx"
GK"namepcx"
GM"namepcx",3042
..... and here follows monochrome PCX data ...
..... with 128-bit header and following pixel data 1 bit-per pixel..

"namepcx"   GM , PCX, . GW . " -". "-" GM (, ), . , , 10 000 . , Java, . , - , "" -. (, LP 2824 , - 100k ).

, , GW imag 3- GK GM GG .

+1

: SVG-to-EPL-transpiler,

GW .

GK - GK - GM - GG , PCX, (afaik LRE).

( /) #, -. , :

[NotNull]
public IEnumerable<byte> GetRawBinaryData([NotNull] Bitmap bitmap,
                                          int octetts)
{
  var height = bitmap.Height;
  var width = bitmap.Width;

  for (var y = 0;
        y < height;
        y++)
  {
    for (var octett = 0;
          octett < octetts;
          octett++)
    {
      var value = (int) byte.MaxValue;

      for (var i = 0;
            i < 8;
            i++)
      {
        var x = octett * 8 + i;
        var bitIndex = 7 - i;
        if (x < width)
        {
          var color = bitmap.GetPixel(x,
                                      y);
          if (color.A > 0x32
              || color.R > 0x96 && color.G > 0x96 && color.B > 0x96)
          {
            value &= ~(1 << bitIndex);
          }
        }
      }

      yield return (byte) value;
    }
  }
}

The thing you should keep in mind for conversions:

  • 1: white dot
  • 0: black dot
  • width must be a multiple of 8 (as we send bytes) - the above code will take care of this by filling
  • label rotation / orientation!
  • a certain threshold is defined here ...

I also implemented GM- GGbut this is beyond the scope of this answer. The corresponding code can be found at EplCommands.StoreGraphics(bitmap:Bitmap,name:string).

0
source

All Articles