private void CurrentStationCB_SelectedIndexChanged(object sender, System.EventArgs e) { if (CurrentStationCB.Text == "Receipt") { CurrentStation = PrinterStation.Receipt; } else if (CurrentStationCB.Text == "Slip") { CurrentStation = PrinterStation.Slip; } else if (CurrentStationCB.Text == "Journal") { CurrentStation = PrinterStation.Journal; } else if (CurrentStationCB.Text == "SlipJournal") { CurrentStation = PrinterStation.TwoSlipJournal; } else if (CurrentStationCB.Text == "SlipReceipt") { CurrentStation = PrinterStation.TwoSlipReceipt; } else if (CurrentStationCB.Text == "ReceiptJournal") { CurrentStation = PrinterStation.TwoReceiptJournal; } }
public void Execute(PosPrinter printer, PrinterStation station) { if (!printer.CapRecBarCode && station == PrinterStation.Receipt || !printer.CapSlpBarCode && station == PrinterStation.Slip) { return; } var alignment = 0; switch (Alignment) { case Alignment.Center: alignment = PosPrinter.PrinterBarCodeCenter; break; case Alignment.Left: alignment = PosPrinter.PrinterBarCodeLeft; break; case Alignment.Right: alignment = PosPrinter.PrinterBarCodeRight; break; } printer.PrintBarCode(station, Data, Symbology, Height, Width, alignment, TextPosition); }
public void Execute(PosPrinter printer, PrinterStation station) { if (!printer.CapRecBitmap && station == PrinterStation.Receipt || !printer.CapSlpBitmap && station == PrinterStation.Slip) { return; } if (!File.Exists(FileName)) { return; } var alignment = 0; switch (Alignment) { case Alignment.Center: alignment = PosPrinter.PrinterBitmapCenter; break; case Alignment.Left: alignment = PosPrinter.PrinterBitmapLeft; break; case Alignment.Right: alignment = PosPrinter.PrinterBitmapRight; break; } printer.PrintBitmap(PrinterStation.Receipt, FileName, PosPrinter.PrinterBitmapAsIs, alignment); }
protected override PrintResults PrintNormalImpl(PrinterStation station, PrinterState printerState, string data) { if (station == PrinterStation.Receipt && (printerState.RecRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) { Window.DisplayText("[Begin " + printerState.RecRotationMode.ToString() + " rotation]\r\n"); } else if (station == PrinterStation.Slip && (printerState.SlpRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) { Window.DisplayText("[Begin " + printerState.SlpRotationMode.ToString() + " rotation]\r\n"); } Window.DisplayText(data); if (station == PrinterStation.Receipt && (printerState.RecRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) { Window.DisplayText("[End " + printerState.RecRotationMode.ToString() + " rotation]\r\n"); } else if (station == PrinterStation.Slip && (printerState.SlpRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) { Window.DisplayText("[End " + printerState.SlpRotationMode.ToString() + " rotation]\r\n"); } Thread.Sleep(printDelay); return(GetPrintStats(station, data.Length)); }
public void Execute(PosPrinter printer, PrinterStation station) { if (!printer.CapRecStamp && station == PrinterStation.Receipt) { return; } printer.PrintNormal(station, EscapeSequence.FireStamp); }
public override void PrintMemoryBitmap(PrinterStation station, Bitmap data, int width, int alignment) { using (MemoryStream ms = new MemoryStream()) { data.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); string memorybitmap = InteropCommon.ToStringFromByteArray(ms.ToArray(), _binaryConversion); VerifyResult(_cco.PrintMemoryBitmap((int)station, memorybitmap, (int)OPOSPOSPrinterConstants.PTR_BMT_BMP, width, alignment)); } }
public void Execute(PosPrinter printer, PrinterStation station) { if (!printer.CapRecPaperCut && station == PrinterStation.Receipt) { return; } printer.PrintNormal(station, EscapeSequence.FeedAndPaperCut(PercentCut)); }
public void Execute(PosPrinter printer, PrinterStation station) { if (!printer.CapRecBitmap && station == PrinterStation.Receipt || !printer.CapSlpBitmap && station == PrinterStation.Slip) { return; } printer.PrintNormal(station, EscapeSequence.PrintBitmap(BitmapNumber)); }
private PrintResults GetPrintStats(PrinterStation station, int chars) { PrintResults pr = new PrintResults(); if (station == PrinterStation.Journal) { pr.JournalLinePrintedCount = 1; pr.JournalCharacterPrintedCount = chars; } else if (station == PrinterStation.Receipt) { pr.ReceiptLinePrintedCount = 1; pr.ReceiptCharacterPrintedCount = chars; } else if (station == PrinterStation.Slip) { pr.SlipLinePrintedCount = 1; pr.SlipCharacterPrintedCount = chars; } return(pr); }
public void Execute(PosPrinter printer, PrinterStation station) { if (CharactersPerLine.HasValue) { if (station == PrinterStation.Receipt) { printer.RecLineChars = CharactersPerLine.Value; } else if (station == PrinterStation.Slip) { printer.SlpLineChars = CharactersPerLine.Value; } } if (station == PrinterStation.Slip) { printer.PrintNormal(station, Text); } else { printer.PrintNormal(station, ToString()); } }
public override void RotatePrint(PrinterStation station, PrintRotation rotation) { VerifyResult(_cco.RotatePrint((int)station, (int)rotation)); }
public override void PrintNormal(PrinterStation station, string data) { VerifyResult(_cco.PrintNormal((int)station, data)); }
public override void PrintTwoNormal(PrinterStation stations, string data1, string data2) { VerifyResult(_cco.PrintTwoNormal((int)stations, data1, data2)); }
public override void PrintImmediate(PrinterStation station, string data) { VerifyResult(_cco.PrintImmediate((int)station, data)); }
private void CurrentStationCB_SelectedIndexChanged(object sender, System.EventArgs e) { if (CurrentStationCB.Text == "Receipt") CurrentStation = PrinterStation.Receipt; else if (CurrentStationCB.Text == "Slip") CurrentStation = PrinterStation.Slip; else if (CurrentStationCB.Text == "Journal") CurrentStation = PrinterStation.Journal; else if (CurrentStationCB.Text == "SlipJournal") CurrentStation = PrinterStation.TwoSlipJournal; else if (CurrentStationCB.Text == "SlipReceipt") CurrentStation = PrinterStation.TwoSlipReceipt; else if (CurrentStationCB.Text == "ReceiptJournal") CurrentStation = PrinterStation.TwoReceiptJournal; }
public override void ValidateData(PrinterStation station, string data) { VerifyResult(_cco.ValidateData((int)station, data)); }
protected override PrintResults PrintNormalImpl(PrinterStation station, PrinterState printerState, string data) { if (station == PrinterStation.Receipt && (printerState.RecRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) Window.DisplayText("[Begin " + printerState.RecRotationMode.ToString() + " rotation]\r\n"); else if (station == PrinterStation.Slip && (printerState.SlpRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) Window.DisplayText("[Begin " + printerState.SlpRotationMode.ToString() + " rotation]\r\n"); Window.DisplayText(data ); if (station == PrinterStation.Receipt && (printerState.RecRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) Window.DisplayText("[End " + printerState.RecRotationMode.ToString() + " rotation]\r\n"); else if (station == PrinterStation.Slip && (printerState.SlpRotationMode & PrintRotation.Rotate180) == PrintRotation.Rotate180) Window.DisplayText("[End " + printerState.SlpRotationMode.ToString() + " rotation]\r\n"); Thread.Sleep(printDelay); return GetPrintStats(station, data.Length); }
protected override PrintResults PrintImmediateImpl(PrinterStation station, string data, PrinterState state) { Window.DisplayText(data); Thread.Sleep(printDelay); return(GetPrintStats(station, data.Length)); }
public override void DrawRuledLine(PrinterStation station, string positionList, LineDirection direction, int lineWidth, LineStyle style, int lineColor) { VerifyResult(_cco.DrawRuledLine((int)station, positionList, (int)direction, lineWidth, (int)style, lineColor)); }
protected override void ValidateDataImpl(PrinterStation station, string data) { }
public void Execute(PosPrinter printer, PrinterStation station) { printer.PrintNormal(station, EscapeSequence.FeedReverse(Lines)); }
protected override PrintResults PrintImmediateImpl(PrinterStation station, string data, PrinterState state) { Window.DisplayText(data ); Thread.Sleep(printDelay); return GetPrintStats(station, data.Length); }
private PrintResults GetPrintStats(PrinterStation station, int chars) { PrintResults pr = new PrintResults(); if (station == PrinterStation.Journal) { pr.JournalLinePrintedCount = 1; pr.JournalCharacterPrintedCount = chars; } else if (station == PrinterStation.Receipt) { pr.ReceiptLinePrintedCount = 1; pr.ReceiptCharacterPrintedCount = chars; } else if (station == PrinterStation.Slip) { pr.SlipLinePrintedCount = 1; pr.SlipCharacterPrintedCount = chars; } return pr; }
public override void SetBitmap(int bitmapNumber, PrinterStation station, string fileName, int width, int alignment) { VerifyResult(_cco.SetBitmap(bitmapNumber, (int)station, fileName, width, alignment)); }
public override void PrintBarCode(PrinterStation station, string data, BarCodeSymbology symbology, int height, int width, int alignment, BarCodeTextPosition textPosition) { VerifyResult(_cco.PrintBarCode((int)station, data, (int)symbology, height, width, alignment, (int)textPosition)); }
public override void TransactionPrint(PrinterStation station, PrinterTransactionControl control) { VerifyResult(_cco.TransactionPrint((int)station, (int)control)); }
public override void PrintBitmap(PrinterStation station, string fileName, int width, int alignment) { VerifyResult(_cco.PrintBitmap((int)station, fileName, width, alignment)); }
public void Execute(PosPrinter printer, PrinterStation station) { printer.PrintNormal(station, EscapeSequence.PrintTopLogo); }
public void Execute(PosPrinter printer, PrinterStation station) { printer.PrintNormal(station, EscapeSequence.FeedUnits(Units)); }