bar receipt

This commit is contained in:
EugeneTes
2026-01-21 09:19:12 +01:00
parent e5a44e5fde
commit fe18db2642
5 changed files with 268 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
using System.Text.Json;
namespace Inspectron.Epson.PrintServer.Printers.Utils.BarReceipt;
public class BarReceiptConverterAdapter : IReceiptConverter
{
private readonly int _lineWidth;
private readonly int _bigFontLineWidth;
public BarReceiptConverterAdapter(int lineWidth, int bigFontLineWidth)
{
_lineWidth = lineWidth;
_bigFontLineWidth = bigFontLineWidth;
}
public List<PrintCommand> Convert(string jsonContent)
{
var receipt = JsonSerializer.Deserialize<BarReceipt>(jsonContent);
var converter = new BarReceiptConverter(_lineWidth, _bigFontLineWidth);
return converter.ConvertToPrintCommands(receipt);
}
}