Die im Anschluss an die ESC-Codes für Micrsoft.PointOfService Drucker sind:Wie ESC senden Controls Microsoft.PointOfService Emulator
string escAlignCenter = String.Format("{0}|cA", ((char)27));
string escAlignRight = String.Format("{0}|rA", ((char)27));
string escBoldOn = String.Format("{0}|bC", ((char)27));
string escNewLine = String.Format("{0}|1lF", ((char)27));
string escPaperCut = String.Format("{0}{1}|P", ((char)27), AppSettings.POSPrinterLinesToCut);
string escReset = String.Format("{0}|N", ((char)27));
string escUnderlineOn = String.Format("{0}|uC", ((char)27));
Dieser Code
simulatedReceipt.AppendLine(string.Format("{0}{1}Header will appear Here{2}", escBoldOn, escAlignCenter, escReset));
, wenn sie mit
an den Simulator Drucker gesendettextToPrint = simulatedReceipt.ToString();
posPrinter.PrintNormal(PrinterStation.Receipt, textToPrint);
Ergebnisse in:
System.FormatException occurred
HResult=-2146233033
Message=Input string was not in a correct format.
Source=mscorlib
StackTrace:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Microsoft.PointOfService.DeviceSimulators.PosPrinterSimulatorWindow.ProcessEscapes(String str)
at Microsoft.PointOfService.DeviceSimulators.PosPrinterSimulatorWindow.DisplayText(String str)
at Microsoft.PointOfService.DeviceSimulators.PosPrinterSimulator.PrintNormalImpl(PrinterStation station, PrinterState printerState, String data)
at Microsoft.PointOfService.BaseServiceObjects.PosPrinterBase.OutputRequestHandler(OutputRequest Request)
at Microsoft.PointOfService.Internal.PosCommonInternal.ProcessOutputRequest(OutputRequest request, Boolean asyncOperation)
at MyCourts.PrintReceiptManager.printToPOSPrinter() in e:\MyCourts\MyCourts\Managers\PrintReceiptManager.cs:line 558
InnerException:
Leider habe ich keinen geeigneten Quittungsdrucker, um es zu testen, aber ich vermute, dass der Fehler nur mit dem eingebauten Thermodruckersimulator auftritt.
Kann mir bitte jemand meinen Verdacht bestätigen.