原創|使用教程|編輯:龔雪|2016-03-29 13:21:36.000|閱讀 447 次
概述:大多數熱敏打印機不提供打印多列標簽的媒體滾動內置機制。為了突破這個限制,ThermalLabel SDK提供的out-of-the-box屬性可以讓您打印任意數量的每一列標簽!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
本次教程中我們將會使用到的多列標簽布局如下圖所示:
'Define a ThermalLabel object and set unit to MM and label size Dim tLabel As New ThermalLabel(UnitType.Mm, 50, 0) 'Set the number of labels per row tLabel.LabelsPerRow = 2 'Set the horiz gap between labels tLabel.LabelsHorizontalGapLength = 3 'Define a TextItem object Dim txt As New TextItem(5, 5, "Decreasing 50") 'Set font... txt.Font.CharHeight = 14 'set Counter... txt.CounterStep = -1 'Define a BarcodeItem object Dim bc As New BarcodeItem(5, 15, BarcodeSymbology.Code128, "ABC01") 'Set bars' width and height... bc.BarWidth = 0.4 bc.BarHeight = 10 'set Counter... bc.CounterStep = 1 bc.CounterUseLeadingZeros = True 'Add items to ThermalLabel object... tLabel.Items.Add(txt) tLabel.Items.Add(bc) 'Create a PrintJob object Dim pj As New PrintJob() 'Thermal Printer is connected through USB pj.PrinterSettings.Communication.CommunicationType = CommunicationType.USB 'Set Thermal Printer resolution pj.PrinterSettings.Dpi = 203 'Set Thermal Printer language pj.PrinterSettings.ProgrammingLanguage = ProgrammingLanguage.ZPL 'Set Thermal Printer name pj.PrinterSettings.PrinterName = "Zebra GK420t" 'Set Copies to 10!!! pj.Copies = 10 'Print ThermalLabel object... pj.Print(tLabel)
//Define a ThermalLabel object and set unit to MM and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Mm, 50, 0); //Set the number of labels per row tLabel.LabelsPerRow = 2; //Set the horiz gap between labels tLabel.LabelsHorizontalGapLength = 3; //Define a TextItem object TextItem txt = new TextItem(5, 5, "Decreasing 50"); //Set font... txt.Font.CharHeight = 14; //set Counter... txt.CounterStep = -1; //Define a BarcodeItem object BarcodeItem bc = new BarcodeItem(5, 15, BarcodeSymbology.Code128, "ABC01"); //Set bars' width and height... bc.BarWidth = 0.4; bc.BarHeight = 10; //set Counter... bc.CounterStep = 1; bc.CounterUseLeadingZeros = true; //Add items to ThermalLabel object... tLabel.Items.Add(txt); tLabel.Items.Add(bc); //Create a PrintJob object PrintJob pj = new PrintJob(); //Thermal Printer is connected through USB pj.PrinterSettings.Communication.CommunicationType = CommunicationType.USB; //Set Thermal Printer resolution pj.PrinterSettings.Dpi = 203; //Set Thermal Printer language pj.PrinterSettings.ProgrammingLanguage = ProgrammingLanguage.ZPL; //Set Thermal Printer name pj.PrinterSettings.PrinterName = "Zebra GK420t"; //Set Copies to 10!!! pj.Copies = 10; //Print ThermalLabel object... pj.Print(tLabel);
'Define a ThermalLabel object and set unit to MM and label size Dim tLabel As New ThermalLabel(UnitType.Mm, 50, 30) 'Set the number of labels per row tLabel.LabelsPerRow = 2 'Set the horiz gap between labels tLabel.LabelsHorizontalGapLength = 3 'Set the vertical gap between labels tLabel.GapLength = 3 'Define a TextItem object Dim txt As New TextItem(5, 5, "Decreasing 50") 'Set font... txt.Font.Name = "2" txt.Font.CharHeight = 14 txt.Font.CharWidth = 8 'set Counter... txt.CounterStep = -1 'Define a BarcodeItem object Dim bc As New BarcodeItem(5, 15, BarcodeSymbology.Code128, "ABC01") 'Set bars' width and height... bc.BarWidth = 0.4 bc.BarHeight = 10 'set Counter... bc.CounterStep = 1 bc.CounterUseLeadingZeros = True 'Add items to ThermalLabel object... tLabel.Items.Add(txt) tLabel.Items.Add(bc) 'Create a PrintJob object Dim pj As New PrintJob() 'Thermal Printer is connected through USB pj.PrinterSettings.Communication.CommunicationType = CommunicationType.USB 'Set Thermal Printer resolution pj.PrinterSettings.Dpi = 203 'Set Thermal Printer language pj.PrinterSettings.ProgrammingLanguage = ProgrammingLanguage.EPL 'Set Thermal Printer name pj.PrinterSettings.PrinterName = "Zebra GK420t" 'Set Copies to 10!!! pj.Copies = 10 'Print ThermalLabel object... pj.Print(tLabel)
//Define a ThermalLabel object and set unit to MM and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Mm, 50, 0); //Set the number of labels per row tLabel.LabelsPerRow = 2; //Set the horiz gap between labels tLabel.LabelsHorizontalGapLength = 3; //Set the vertical gap between labels tLabel.GapLength = 3; //Define a TextItem object TextItem txt = new TextItem(5, 5, "Decreasing 50"); //Set font... txt.Font.Name = "2"; txt.Font.CharHeight = 14; txt.Font.CharWidth = 8; //set Counter... txt.CounterStep = -1; //Define a BarcodeItem object BarcodeItem bc = new BarcodeItem(5, 15, BarcodeSymbology.Code128, "ABC01"); //Set bars' width and height... bc.BarWidth = 0.4; bc.BarHeight = 10; //set Counter... bc.CounterStep = 1; bc.CounterUseLeadingZeros = true; //Add items to ThermalLabel object... tLabel.Items.Add(txt); tLabel.Items.Add(bc); //Create a PrintJob object PrintJob pj = new PrintJob(); //Thermal Printer is connected through USB pj.PrinterSettings.Communication.CommunicationType = CommunicationType.USB; //Set Thermal Printer resolution pj.PrinterSettings.Dpi = 203; //Set Thermal Printer language pj.PrinterSettings.ProgrammingLanguage = ProgrammingLanguage.EPL; //Set Thermal Printer name pj.PrinterSettings.PrinterName = "Zebra GK420t"; //Set Copies to 10!!! pj.Copies = 10; //Print ThermalLabel object... pj.Print(tLabel);
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn