问题
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