public void PrintVoucher(string printerName, string printDocumentName, int length, string documentInitialization, IList <IPrintLine> lines) { Debug.Assert(!string.IsNullOrEmpty(printerName)); var b = new StringBuilder(); b.Append(MTPL.PUMOn(true)); b.Append(MTPL.SetFormLength(length));//6119 b.AppendLine(documentInitialization); PrintLine lastLine = null; const int MIN_V_STEP = 50; foreach (PrintLine line in lines) { if (lastLine == null || Math.Abs(line.Y - lastLine.Y) > MIN_V_STEP) { b.Append(MTPL.SetAbsolutePosition((int)line.X, (int)line.Y)); } else { b.Append(MTPL.SetAbsoluteHorizontalPosition((int)line.X)); } line.Print(b); lastLine = line; } b.Append(ASCII.FF); string text = b.ToString(); PrinterQueue.AddJob(printerName, printDocumentName, text); }
public VoucherPrintLayout380() : base() { LINE_LEN_LIMIT = 25; VATLine = new PrintLine("VAT"); RegLine = new PrintLine("Reg"); CapLine = new PrintLine("Cap"); ReaLine = new PrintLine("Rea"); }
public VoucherPrintLayout826() { BarCodeNo = new BarCodeLine("BarCodeNo"); BarCodeText = new PrintLine("BarCodeText"); ShopName = new PrintLine("ShopName"); VoucherID = new PrintLine("VoucherID"); ShopNo = new PrintLine("ShopNo"); Line0 = new PrintLine("Line0"); Line1 = new PrintLine("Line1"); Line2 = new PrintLine("Line2"); Line3 = new PrintLine("Line3"); VATNumber = new PrintLine("VATNumber"); DocumentInitialization = string.Empty; }
public VoucherPrintLayout250() { BarCodeNo = new PrintLine("BarCodeNo"); BarCodeText = new PrintLine("BarCodeText"); RetailerID = new PrintLine("RetailerID"); Line1 = new PrintLine("Line1"); Line5 = new PrintLine("Line5"); Line3 = new PrintLine("Line3"); Phone = new PrintLine("Phone"); VoucherID = new PrintLine("VoucherID"); VATNumber = new PrintLine("VATNumber"); ShopName = new PrintLine("ShopName"); Line2 = new PrintLine("Line2"); }
public static PrintLine Copy(PrintLine from) { return(new PrintLine() { MaxX = from.MaxX, MaxY = from.MaxY, MinX = from.MinX, MinY = from.MinY, Size = from.Size, Text = from.Text, Description = from.Description, X = from.X, Y = from.Y }); }