ReceiptSharp
.NET printing library for receipt printers, simple and easy with receipt markdown, printer status support.
using ReceiptSharp;
string example = @"^^^RECEIPT
11/30/2025, 12:34:56 PM
Asparagus | 1| 1.00
Broccoli | 2| 2.00
Carrot | 3| 3.00
---
^TOTAL | ^6.00";
ReceiptSession session = new ReceiptSession("192.168.192.168");
session.Ready += async (sender, e) => Console.WriteLine(await session.Print(example));
session.Open();
Console.ReadLine();
session.Close();
Console.WriteLine(new Receipt(example).ToSvg());

Features
ReceiptSharp is simple printing library for receipt printers that prints with easy markdown data for receipts and returns printer status. Even without a printer, it can output images.
ReceiptSharp auto-detects printer models for seamless printing.
A development tool is provided to edit, preview, and print the receipt markdown.
https://receiptline.github.io/receiptjs-designer/
Receipt printers
- Epson TM series
- Seiko Instruments RP series
- Star MC series
- Citizen CT series
- Fujitsu FP series
Connect with IP address or serial port.
(LAN, Bluetooth, virtual serial port, and real serial port)
Epson TM series (South Asia model) and Star MC series (StarPRNT model) can print with device font of Thai characters.

ReceiptSession Class
Namespace: ReceiptSharp
Print receipt markdown text and notify printer status.
Examples
using ReceiptSharp;
string example = @"^^^RECEIPT
11/30/2025, 12:34:56 PM
Asparagus | 1| 1.00
Broccoli | 2| 2.00
Carrot | 3| 3.00
---
^TOTAL | ^6.00";
ReceiptSession session = new ReceiptSession("COM1");
session.StatusChanged += (sender, e) =>
{
Console.WriteLine(e);
};
session.Ready += async (sender, e) =>
{
string result = await session.Print(example, "-c 42 -u");
Console.WriteLine(result);
};
session.Open();
Console.ReadLine();
session.Close();
Constructors
| Name |
Description |
| ReceiptSession(String) |
Create instance. |
Properties
| Name |
Description |
| Status |
Printer status. |
| Drawer |
Cash drawer status. |
Methods
| Name |
Description |
| Open() |
Open session. |
| Print(String, String) |
Print receipt markdown. |
| InvertDrawerState(Boolean) |
Invert cash drawer state. |
| Close() |
Close session. |
Events
| Name |
Description |
| StatusChanged |
Printer status updated. |
| Ready |
Ready to print. |
| Online |
Printer is online. |
| CoverOpen |
Printer cover is open. |
| PaperEmpty |
No receipt paper. |
| Error |
Printer error (except cover open and paper empty). |
| Offline |
Printer is off or offline. |
| Disconnect |
Printer is not connected. |
| DrawerChanged |
Drawer status updated. |
| DrawerClosed |
Drawer is closed. |
| DrawerOpen |
Drawer is open. |
ReceiptSession Constructor
public ReceiptSession(string destination)
The ReceiptSession() constructor creates a new ReceiptSession instance.
Parameters
destination
- IP address or serial port of target printer
Serial port options:
<port name>[:<options>]
<options>
<baud rate>,<parity>,<data bits>,<stop bits>[,<flow control>]
- Default:
9600,N,8,1,N
- Commas can be omitted
<baud rate>
2400, 4800, 9600, 19200, 38400, 57600, 115200
<parity>
<data bits>
<stop bits>
<flow control>
N: None, R: RTS/CTS, X: XON/XOFF
Returns
- A new ReceiptSession instance.
ReceiptSession.Status Property
public string Status { get; }
The Status property is a string representing the printer status.
Property Value
- A string representing the printer status.
Online: Printer is online
Print: Printer is printing
CoverOpen: Printer cover is open
PaperEmpty: No receipt paper
Error: Printer error (except cover open and paper empty)
Offline: Printer is off or offline
Disconnect: Printer is not connected
ReceiptSession.Drawer Property
public string Drawer { get; }
The Drawer property is a string representing the cash drawer status.
Property Value
- A string representing the cash drawer status.
DrawerClosed: Drawer is closed
DrawerOpen: Drawer is open
Offline: Printer is off or offline
Disconnect: Printer is not connected
ReceiptSession.Open Method
The Open() method starts a session and connects to the target printer.
ReceiptSession.Print Method
public async Task<string> Print(string markdown, string options = "")
The Print() method prints a receipt markdown text.
Parameters
markdown
options
-c <chars>: Characters per line
-l <language>: Language of receipt markdown text
en, fr, de, es, po, it, ru, ...: Multilingual (cp437, 852, 858, 866, 1252 characters)
ja: Japanese (shiftjis characters)
ko: Korean (ksc5601 characters)
zh-hans: Simplified Chinese (gb18030 characters)
zh-hant: Traditional Chinese (big5 characters)
th: Thai
- Default: System locale
-s: Paper saving (reduce line spacing)
-m [<left>][,<right>]: Print margin
- Range (left):
0-24
- Range (right):
0-24
- Default:
0,0
-u: Upside down
-i: Print as image
-n: No paper cut
-b <threshold>: Image thresholding
- Range:
0-255
- Default: Error diffusion
-g <gamma>: Image gamma correction
- Range:
0.1-10.0
- Default:
1.0
-p <printer>: Printer control language
escpos: ESC/POS (Epson)
epson: ESC/POS (Epson)
sii: ESC/POS (Seiko Instruments)
citizen: ESC/POS (Citizen)
fit: ESC/POS (Fujitsu)
impact: ESC/POS (TM-U220)
impactb: ESC/POS (TM-U220 Font B)
generic: ESC/POS (Generic) Experimental
star: StarPRNT
starline: Star Line Mode
emustarline: Command Emulator Star Line Mode
stargraphic: Star Graphic Mode
starimpact: Star Mode on dot impact printers Experimental
starimpact2: Star Mode on dot impact printers (Font 5x9 2P-1) Experimental
starimpact3: Star Mode on dot impact printers (Font 5x9 3P-1) Experimental
- Default: Auto detection (
epson, sii, citizen, fit, impactb, generic, star)
-v: Landscape orientation
- Device font support:
escpos, epson, sii, citizen, star
-r <dpi>: Print resolution for ESC/POS, landscape, and device font
- Values:
180, 203
- Default:
203
Returns
- A Task that fulfills with a string once the print result is ready to be used.
Success: Printing success
Print: Printer is printing
CoverOpen: Printer cover is open
PaperEmpty: No receipt paper
Error: Printer error (except cover open and paper empty)
Offline: Printer is off or offline
Disconnect: Printer is not connected
ReceiptSession.InvertDrawerState Method
public void InvertDrawerState(bool invert)
The InvertDrawerState() method inverts cash drawer state.
Parameters
invert
- If true, invert drawer state
ReceiptSession.Close Method
The Close() method closes the connection and ends the session.
Receipt Class
Namespace: ReceiptSharp
Convert to image, plain text, or printer commands.
Examples