私はたくさん検索しましたが、ここで Posexplorer の例を見つけましたが、私のプリンターは USB で、PosExplorer は並列用であると読みました。プリンターで印刷する方法と、コードをプリンターに送信して引き出しを開く方法がわかりません。
次のコードを使用して、エスケープシーケンスをプリンターに送信しています。
string ESC = Convert.ToString((char)27);
string logo=Convert.ToString(ESC+"|tL");
_oposPrinter.PrintNormal(PrinterStation.Receipt, logo);
_oposPrinter.PrintNormal(PrinterStation.Receipt, "Print example\n");
_oposPrinter.PrintNormal(PrinterStation.Receipt, Convert.ToString((char)27 + "|#fP"));
デバッグして行に到達すると:
_oposPrinter.PrintNormal(PrinterStation.Receipt, logo);
また
_oposPrinter.PrintNormal(PrinterStation.Receipt, Convert.ToString((char)27 + "|#fP"));
プリンターは何も印刷しません。