Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ESC-POS-USB-NET/Epson Commands/FontMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ public byte[] Font(Fonts state)
}
return new byte[] { 27, 'M'.ToByte(), fnt };
}

public byte[] Reverse(string value)
{
return Reverse(PrinterModeState.On)
.AddBytes(value)
.AddBytes(Reverse(PrinterModeState.Off))
.AddLF();
}

public byte[] Reverse(PrinterModeState state)
{
return state == PrinterModeState.On
? new byte[] { 29, 'B'.ToByte(), 1 }
: new byte[] { 29, 'B'.ToByte(), 0 };
}
}
}

2 changes: 2 additions & 0 deletions ESC-POS-USB-NET/Interfaces/Command/IFontMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ internal interface IFontMode
{
byte[] Bold(string value);
byte[] Bold(PrinterModeState state);
byte[] Reverse(string value);
byte[] Reverse(PrinterModeState state);
byte[] Underline(string value);
byte[] Underline(PrinterModeState state);
byte[] Expanded(string value);
Expand Down
13 changes: 13 additions & 0 deletions ESC-POS-USB-NET/Printer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public void TestPrinter()
BoldMode("Bold Text");
UnderlineMode("Underlined text");
Separator();
Append("Text Reversed");
ReverseMode("Reversed text");
Separator();
ExpandedMode(PrinterModeState.On);
Append("Expanded - 23 COLUMNS");
Append("1...5...10...15...20..23");
Expand Down Expand Up @@ -179,6 +182,16 @@ public void BoldMode(PrinterModeState state)
Append(_command.FontMode.Bold(state));
}

public void ReverseMode(string value)
{
Append(_command.FontMode.Reverse(value));
}

public void ReverseMode(PrinterModeState state)
{
Append(_command.FontMode.Reverse(state));
}

public void Font(string value, Fonts state)
{
Append(_command.FontMode.Font(value, state));
Expand Down