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

和自甴很熟 提交于 2019-12-24 06:04:41

问题


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.

来源:https://stackoverflow.com/questions/41224155/ascii-code-for-dot-matrix-printer-for-changing-ribbon-in-c-sharp-using-raw-print

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!