ASCII CODE for Dot Matrix Printer for changing Ribbon in C# using Raw Printing

898 Views Asked by At

I am printing receipts using Dot Matrix Printer in C#.

The printer works perfectly, prints characters in bold, large size etc.

The problem is dot matrix have ribbons in it (Black color, Red Color)

How can i specify which text is to be printed in black or red.

I am using BinaryWriter to pass string and ascii code to get desired output.

Example:

 bw.Write((byte)0);

 byte[] bytes = Encoding.ASCII.GetBytes(text);

 foreach (var by in bytes)
 {
    bw.Write((byte)by);

 }

Some Sample Code Reference:

Sample Code

Any help is appreciated.

UPDATE:

The printer used is Sewoo SLK-D30 Sewoo SLK-D30

The document says:

   Command  HexCode    Description

   DC3      <13>H      Red color print command

But not able to proceed.

0

There are 0 best solutions below