This epson fiscal printer is a small library to print fiscal invoices and non fiscal documents using C#.
I have tested this library with the Epson FP81.
Currently the api only works with the default port: 9100
EpsonFiscalPrinter epsonFiscalPrinter = new EpsonFiscalPrinter("<ip_address>");
epsonFiscalPrinter.BeginInvoice();
epsonFiscalPrinter.AddProduct("Your product", 21.9m);
epsonFiscalPrinter.AddProduct("Another product", 5m);
epsonFiscalPrinter.EndInvoice(PaymentType.CASH);
var epsonFiscalPrinterResponse = epsonFiscalPrinter.Print();
if (!epsonFiscalPrinterResponse.IsSuccess) {
Console.WriteLine("ErrorResponse code:" + epsonFiscalPrinterResponse.Code + " status: " + epsonFiscalPrinterResponse.Status + " AdditionalInfo: " + epsonFiscalPrinterResponse.AdditionalInfo);
}
EpsonFiscalPrinter epsonFiscalPrinter = new EpsonFiscalPrinter("<ip_address>");
epsonFiscalPrinter.BeginDocument();
epsonFiscalPrinter.AddTextToDocument("Hello world!", FontType.LARGE);
epsonFiscalPrinter.AddTextToDocument("Here you can write whatever you want");
epsonFiscalPrinter.EndDocument();
epsonFiscalPrinter.Print();
PaymentType.CASH
PaymentType.CREDIT_CARD
epsonFiscalPrinter.Print();