public void Print(ExportDetail itm) { if (Export.SourceTransaction != "Sales Order") { return; } try { for (int i = 0; i < Quantity; i++) { const int VerticalSpace = 150; const int HorizontalSpace = 100; const string LabelFontSize = "2.5"; TSCLIB_DLL.openport(Settings.Default.TSCPrinter); //Open specified printer driver TSCLIB_DLL.setup("101", "150", "6", "8", "0", "5", "0"); //Setup the media size and sensor type info TSCLIB_DLL.clearbuffer(); //Clear image buffer TSCLIB_DLL.downloadpcx("box.pcx", "box.pcx"); //Download PCX file into printer TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * .5).ToString(), "3", "0", "4", "4", "M.N.I.B."); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 1.25).ToString(), "3", "0", "1.75", "1.75", "Young Street, St. George's, Grenada"); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 2.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, Instance.Info.Substring(0, Instance.Info.IndexOf(" - "))); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 3).ToString(), "3", "0", "1.75", "1.75", Instance.Info.Substring(Instance.Info.IndexOf(" - ") + 1)); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 4).ToString(), "3", "0", "2", "2", DateTime.Today.ToString("yyyy-MMM-dd")); //Drawing printer font TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 4.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, itm.Barcode); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 5).ToString(), "3", "0", LabelFontSize, LabelFontSize, Export.ProductDescription); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 5.75).ToString(), "3", "0", "2", "2", Box.Description); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 6.5).ToString(), "3", "0", "2", "2", itm.Weight.ToString()); TSCLIB_DLL.printerfont((HorizontalSpace * 1.5).ToString(), (VerticalSpace * 6.5).ToString(), "3", "0", "2", "2", "LBS."); TSCLIB_DLL.barcode((HorizontalSpace * .5).ToString(), (VerticalSpace * 7).ToString(), "128", "125", "1", "0", "8", "8", itm.Barcode); //Drawing barcode TSCLIB_DLL.printlabel("1", "1"); //Print labels TSCLIB_DLL.closeport(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { //TSCLIB_DLL.about(); //Show the DLL version TSCLIB_DLL.openport("TSC TTP-344M Plus"); //Open specified printer driver TSCLIB_DLL.setup("100", "63.5", "4", "8", "0", "0", "0"); //Setup the media size and sensor type info TSCLIB_DLL.clearbuffer(); //Clear image buffer TSCLIB_DLL.barcode("100", "100", "128", "100", "1", "0", "2", "2", "Barcode Test"); //Drawing barcode TSCLIB_DLL.printerfont("100", "250", "3", "0", "1", "1", "Print Font Test"); //Drawing printer font TSCLIB_DLL.windowsfont(100, 300, 24, 0, 0, 0, "ARIAL", "Windows Arial Font Test"); //Draw windows font TSCLIB_DLL.downloadpcx("UL.PCX", "UL.PCX"); //Download PCX file into printer TSCLIB_DLL.sendcommand("PUTPCX 100,400,\"UL.PCX\""); //Drawing PCX graphic TSCLIB_DLL.printlabel("1", "1"); //Print labels TSCLIB_DLL.closeport(); //Close specified printer driver }
private void PrintMediumSizeLabel(PurchaseOrderDetail itm) { try { const int VerticalSpace = 75; const int HorizontalSpace = 101; const string LabelFontSize = "2.5"; TSCLIB_DLL.openport(Settings.Default.TSCPrinter); //Open specified printer driver TSCLIB_DLL.setup("101", "50.2", "6", "8", "0", "0", "0"); //Setup the media size and sensor type info TSCLIB_DLL.clearbuffer(); //Clear image buffer TSCLIB_DLL.downloadpcx("box.pcx", "box.pcx"); //Download PCX file into printer TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * .5).ToString(), "2", "0", LabelFontSize, LabelFontSize, PurchaseOrder.Vendor); TSCLIB_DLL.printerfont((HorizontalSpace * 5).ToString(), (VerticalSpace * 1.3).ToString(), "2", "0", LabelFontSize, LabelFontSize, PurchaseOrder.PODate.ToString("yyyy-MMM-dd")); //Drawing printer font TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 1.3).ToString(), "3", "0", LabelFontSize, LabelFontSize, "Inv#"); TSCLIB_DLL.printerfont((HorizontalSpace * 2).ToString(), (VerticalSpace * 1.3).ToString(), "3", "0", LabelFontSize, LabelFontSize, itm.PurchaseOrderNo); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 2).ToString(), "3", "0", LabelFontSize, LabelFontSize, "Item:"); TSCLIB_DLL.printerfont((HorizontalSpace * 2.3).ToString(), (VerticalSpace * 2).ToString(), "3", "0", LabelFontSize, LabelFontSize, itm.ItemDescription); TSCLIB_DLL.barcode((HorizontalSpace * .5).ToString(), (VerticalSpace * 3).ToString(), "128", "75", "0", "0", "9", "8", itm.Barcode); //Drawing barcode TSCLIB_DLL.printerfont((HorizontalSpace * 2).ToString(), (VerticalSpace * 4.1).ToString(), "2", "0", "5", "5", itm.Barcode); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 4.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, "SORT"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},2,19.2", HorizontalSpace * 0, VerticalSpace * 4.5, HorizontalSpace * 2, VerticalSpace * 4.5 + 50)); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 5.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, "GRADED"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},2,19.2", HorizontalSpace * 4, VerticalSpace * 5.5, HorizontalSpace * 8, VerticalSpace * 5.5 + 50)); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 6.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, "WASH"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},2,19.2", HorizontalSpace * 4, VerticalSpace * 6.5, HorizontalSpace * 8, VerticalSpace * 6.5 + 50)); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 7.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, "CHILLER#"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},2,19.2", HorizontalSpace * 4, VerticalSpace * 7.5, HorizontalSpace * 8, VerticalSpace * 7.5 + 49)); TSCLIB_DLL.printlabel("1", itm.LabelQty.ToString()); //Print labels TSCLIB_DLL.closeport(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected void Button1_Click(object sender, EventArgs e) { //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "msg", "alert('Hello TSCLIB.DLL')", true); //TSCLIB_DLL.about(); //Show the DLL version TSCLIB_DLL.openport("TSC TTP-245C"); //Open specified printer driver TSCLIB_DLL.setup("100", "63.5", "4", "8", "0", "0", "0"); //Setup the media size and sensor type info TSCLIB_DLL.clearbuffer(); //Clear image buffer TSCLIB_DLL.barcode("100", "100", "128", "100", "1", "0", "2", "2", "Barcode Test"); //Drawing barcode TSCLIB_DLL.printerfont("100", "250", "3", "0", "1", "1", "Print Font Test"); //Drawing printer font TSCLIB_DLL.windowsfont(100, 300, 24, 0, 0, 0, "ARIAL", "Windows Arial Font Test"); //Draw windows font //TSCLIB_DLL.downloadpcx("C:\\ASP.NET_in_VCsharp_2008\\ASP.NET_in_VCsharp_2008\\UL.PCX", "UL.PCX"); //Download PCX file into printer TSCLIB_DLL.downloadpcx("UL.PCX", "UL.PCX"); //Download PCX file into printer TSCLIB_DLL.sendcommand("PUTPCX 100,400,\"UL.PCX\""); //Drawing PCX graphic TSCLIB_DLL.printlabel("1", "1"); //Print labels TSCLIB_DLL.closeport(); }
public bool PrintMUBLabel(string filePath) { try { // Open specified printer driver TSCLIB_DLL.openport(EnumDeviceNames.MUBLabelPrinter); // Setup the media size and sensor type info // page size 100mm x 55mm TSCLIB_DLL.setup("55", "100", "4", "8", "0", "0", "0"); //Clear image buffer TSCLIB_DLL.clearbuffer(); // Download PCX file into printer // TSCLIB_DLL.downloadpcx("UL.PCX", "UL.PCX"); // Drawing PCX graphic TSCLIB_DLL.downloadpcx(filePath, "mublabel.bmp"); //Download PCX file into printer TSCLIB_DLL.sendcommand("PUTBMP 1,1, \"mublabel.bmp\""); //Drawing PCX graphic //Print labels //TSCLIB_DLL.printlabel("1", "1"); TSCLIB_DLL.sendcommand("PRINT 1"); TSCLIB_DLL.closeport(); // Delete temp file File.Delete(filePath); return(true); } catch (Exception ex) { LogManager.Debug(ex.Message); Debug.WriteLine("Print exception: " + ex.ToString()); // Delete temp file File.Delete(filePath); return(false); } }
private void button1_Click(object sender, EventArgs e) { byte[] result = System.Text.Encoding.GetEncoding("utf-16").GetBytes("unicode test"); //TSCLIB_DLL.about(); TSCLIB_DLL.openport("TSC TA210"); TSCLIB_DLL.sendcommand("SIZE 76 mm, 20 mm"); TSCLIB_DLL.sendcommand("SPEED 4"); TSCLIB_DLL.sendcommand("DENSITY 12"); TSCLIB_DLL.sendcommand("DIRECTION 1"); TSCLIB_DLL.sendcommand("SET TEAR ON"); TSCLIB_DLL.clearbuffer(); TSCLIB_DLL.barcode("335", "30", "128", "100", "1", "0", "2", "2", "3410156300419176"); TSCLIB_DLL.barcode("35", "30", "128", "100", "1", "0", "2", "2", "3410156300419176"); //TSCLIB_DLL.printerfont("100", "250", "3", "0", "1", "1", "Print Font Test"); //TSCLIB_DLL.windowsfont(100, 300, 24, 0, 0, 0, "ARIAL", "Windows Arial Font Test"); //TSCLIB_DLL.windowsfontUnicode(100, 350, 24, 0, 0, 0, "ARIAL", result); TSCLIB_DLL.downloadpcx("UL.PCX", "UL.PCX"); TSCLIB_DLL.sendcommand("PUTPCX 100,400,\"UL.PCX\""); TSCLIB_DLL.printlabel("4", "4"); TSCLIB_DLL.closeport(); }
public void Print(ExportDetail itm) { if (Export.SourceTransaction != "Sales Order") { return; } try { const int VerticalSpace = 150; const int HorizontalSpace = 100; const string LabelFontSize = "2.5"; TSCLIB_DLL.openport(Settings.Default.TSCPrinter); //Open specified printer driver TSCLIB_DLL.setup("101", "150", "6", "8", "0", "5", "0"); //Setup the media size and sensor type info TSCLIB_DLL.clearbuffer(); //Clear image buffer TSCLIB_DLL.downloadpcx("box.pcx", "box.pcx"); //Download PCX file into printer TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * .5).ToString(), "3", "0", "4", "4", "M.N.I.B."); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 1.25).ToString(), "3", "0", "1.75", "1.75", "Young Street, St. George's, Grenada"); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 2.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, Customer.CustomerName); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 3).ToString(), "3", "0", "1.75", "1.75", Customer.CustomerAddress); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 4).ToString(), "3", "0", "2", "2", DateTime.Today.ToString("yyyy-MMM-dd")); //Drawing printer font TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 4.5).ToString(), "3", "0", LabelFontSize, LabelFontSize, itm.Barcode); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 5).ToString(), "3", "0", LabelFontSize, LabelFontSize, Export.ProductDescription); TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 5.75).ToString(), "3", "0", "2", "2", Box.Description); TSCLIB_DLL.printerfont((HorizontalSpace * 3).ToString(), (VerticalSpace * 5.75).ToString(), "3", "0", "2", "2", itm.Weight.ToString()); TSCLIB_DLL.printerfont((HorizontalSpace * 4).ToString(), (VerticalSpace * 5.75).ToString(), "3", "0", "2", "2", "LBS."); TSCLIB_DLL.barcode((HorizontalSpace * .5).ToString(), (VerticalSpace * 7).ToString(), "128", "125", "1", "0", "8", "8", itm.Barcode); //Drawing barcode // TSCLIB_DLL.printerfont((HorizontalSpace * 2.3).ToString(), (VerticalSpace * 8.5).ToString(), "3", "0", "2", "2", Box.Description); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 4).ToString(), "3", "0", LabelFontSize, LabelFontSize, "SORT"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},4,19.2", HorizontalSpace * 4,VerticalSpace * 4,HorizontalSpace * 8,VerticalSpace * 4 + 100)); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 5).ToString(), "3", "0", LabelFontSize, LabelFontSize, "GRADED"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},4,19.2", HorizontalSpace * 4, VerticalSpace * 5, HorizontalSpace * 8, VerticalSpace * 5 + 100)); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 6).ToString(), "3", "0", LabelFontSize, LabelFontSize, "WASH"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},4,19.2", HorizontalSpace * 4, VerticalSpace * 6, HorizontalSpace * 8, VerticalSpace * 6 + 100)); //TSCLIB_DLL.printerfont((HorizontalSpace * .5).ToString(), (VerticalSpace * 7).ToString(), "3", "0", LabelFontSize, LabelFontSize, "CHILLER#"); //TSCLIB_DLL.sendcommand(string.Format("BOX {0},{1},{2},{3},4,19.2", HorizontalSpace * 4, VerticalSpace * 7, HorizontalSpace * 8, VerticalSpace * 7 + 100)); TSCLIB_DLL.printlabel("1", "1"); //Print labels TSCLIB_DLL.closeport(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void PrintLogo(string zXPos, string zYPos, string zPCXName) { TSCLIB_DLL.downloadpcx("UL.PCX", "UL.PCX"); TSCLIB_DLL.sendcommand("PUTPCX 224,8,\"UL.PCX\""); TSCLIB_DLL.sendcommand("PUTPCX 576,8,\"UL.PCX\""); }