public ThermalLabel GenerateBasicThermalLabel() { string IdPrint = ID.ToString(); //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 4, 2); tLabel.GapLength = 0.2; //Right, Down BarcodeItem bcID = new BarcodeItem(1.422, 0.2462, 2.5, 0.5083, BarcodeSymbology.QRCode, IdPrint); bcID.AddChecksum = false; bcID.DisplayCode = false; bcID.BarHeight = 0.4; bcID.BarWidth = 0.0104; TextItem txtNumber = new TextItem(1.83000, 1.0922, 1.0938, 0.2083, IdPrint); txtNumber.Font.Name = "Calibri"; txtNumber.Font.Size = 14; txtNumber.Font.Bold = true; tLabel.Items.Add(bcID); tLabel.Items.Add(txtNumber); return(tLabel); }
private void AddKey(ConnectionInfo connectionInfo, List <KeyInfo> listKeyInfo) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { BarcodeInfo bInfo = new BarcodeInfo(); if (listKeyInfo != null) { foreach (KeyInfo keyInfo in listKeyInfo) { VRTicketType vrTicketType = m.VRTicketTypes.Where(x => x.ID == keyInfo.KeyTypeID).FirstOrDefault(); if (vrTicketType != null) { BarcodeItem barcodeItem = new BarcodeItem() { IsPrintingKey = true, KeyName = vrTicketType.Type, Minutes = keyInfo.Minutes }; bInfo.BarcodeItems.Add(barcodeItem); } } GenerateBarcode(connectionInfo, bInfo); GetKey(connectionInfo); } } }
protected void Page_Load(object sender, EventArgs e) {//Define a ThermalLabel object and set unit to inch and label size //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(Neodynamic.SDK.Printing.UnitType.Inch, 4, 3); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txtItem = new TextItem(0.2, 0.2, 1, 0.5, "Thermal Label Test"); //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.2, 1, 2, 1, BarcodeSymbology.Code128, "12345788888888"); //Set bars height to .75inch bcItem.BarHeight = 0.75; //Set bars width to 0.0104inch bcItem.BarWidth = 0.0104; //Add items to ThermalLabel object... tLabel.Items.Add(txtItem); tLabel.Items.Add(bcItem); //Create a PrintJob object using (PrintJob pj = new PrintJob()) { //Save output to PDF... pj.ExportToPdf(tLabel, @"d:\develop\myLabel.pdf", 300); } }
public IHttpActionResult GetBarcodeItem(string barcode) { BarcodeItem item = new BarcodeItem(); dynamic item_attributes = new JObject(); dynamic item_response = new JObject(); using (var DB = new collectorEntities1()) { item = ItemService.GetBarcodeItem(DB, barcode); } if (item != null) { item_attributes.title = item.Title; item_attributes.upc = item.Upc; item_attributes.ean = item.Ean; item_attributes.category = item.Category; item_attributes.model = item.Model; item_attributes.manufacturer = item.Manufacturer; item_attributes.description = item.Description; item_response.code = 200; return(Json(new { item_response, item_attributes, success = true })); } else { item_response = new JObject(); item_response.code = 404; return(Json(new { success = false })); } }
protected void Button1_Click(object sender, EventArgs e) { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(Neodynamic.SDK.Printing.UnitType.Inch, 1, 0.5); tLabel.GapLength = 0.2; //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.2, 0.2, 0.4, 0.6, BarcodeSymbology.Code128, TextBox1.Text); //Set bars height to .75inch //bcItem.BarHeight = 0.04; //Set bars width to 0.0104inch //bcItem.BarWidth = 0.06; bcItem.Tag = ""; //Create a PrintJob object //Create a PrintJob object using (PrintJob pj = new PrintJob()) { tLabel.Items.Add(bcItem); //Save output to image... pj.ExportToImage(tLabel, Server.MapPath("/myLabel.jpeg"), new ImageSettings(ImageFormat.Jpeg), 1000); } Image image = new Image(); image.ImageUrl = "/myLabel.jpeg"; this.Page.Form.Controls.Add(image); }
// GET: Home public ActionResult Index() { BarcodeModel barcodeModel = new BarcodeModel(); barcodeModel.LabelLeftMargin = CmToInc(0); barcodeModel.LabelRightMargin = CmToInc(0.3m); barcodeModel.LabelTopMargin = CmToInc(0.3m); barcodeModel.LabelBottomMargin = CmToInc(0); barcodeModel.LabelLeftPadding = CmToInc(0.1m); barcodeModel.LabelRightPadding = CmToInc(0.1m); barcodeModel.LabelTopPadding = CmToInc(0.1m); barcodeModel.LabelBottomPadding = CmToInc(0.1m); barcodeModel.LabelWidth = CmToInc(6.4m); barcodeModel.LabelHeight = CmToInc(3.8m); barcodeModel.PageWidth = CmToInc(21); barcodeModel.PageLeftMargin = CmToInc(0.7m); barcodeModel.PageRightMargin = CmToInc(0.7m); barcodeModel.PageTopMargin = CmToInc(1); barcodeModel.PageBottomMargin = CmToInc(1); for (int i = 0; i < 21; i++) { BarcodeItem barcodeItem = new BarcodeItem(); barcodeItem.BarcodeData = (new Random().Next(12345, 99999).ToString() + i).PadLeft(8, '0'); barcodeItem.BarcodeTopText = "KKK KUTUPHANESI"; barcodeItem.BarcodeLeftText = "KKT 11-120 (A) </br> N567y </br> 2017"; barcodeModel.BarcodeList.Add(barcodeItem); } return(View(barcodeModel)); }
private ThermalLabel GenerateBasicThermalLabel() { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(Neodynamic.SDK.Printing.UnitType.Inch, 4, 3); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txtItem = new TextItem(0.2, 0.2, 2.5, 0.5, "Thermal Label Test"); //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.2, 1, 2, 1, BarcodeSymbology.Code128, "ABC 12345"); //Set bars height to .75inch bcItem.BarHeight = 0.75; //Set bars width to 0.0104inch bcItem.BarWidth = 0.0104; //Add items to ThermalLabel object... tLabel.Items.Add(txtItem); tLabel.Items.Add(bcItem); return(tLabel); }
private ThermalLabel GenerateThermalLabelDataBinding() { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 3, 2); tLabel.GapLength = 0.2; //Define a TextItem object for product name TextItem txt = new TextItem(0.1, 0.1, 2.8, 0.5, ""); //set data field txt.DataField = "Name"; //set font txt.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontA; txt.Font.Unit = FontUnit.Point; txt.Font.Size = 10; //set border txt.BorderThickness = new FrameThickness(0.03); //set alignment txt.TextAlignment = TextAlignment.Center; txt.TextPadding = new FrameThickness(0, 0.1, 0, 0); //Define a BarcodeItem object for encoding product id with a Code 128 symbology BarcodeItem bc = new BarcodeItem(0.1, 0.57, 2.8, 1.3, BarcodeSymbology.Code128, ""); //set data field bc.DataField = "Id"; //set barcode size bc.BarWidth = 0.01; bc.BarHeight = 0.75; //set barcode alignment bc.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //set text alignment bc.CodeAlignment = BarcodeTextAlignment.BelowCenter; //set border bc.BorderThickness = new FrameThickness(0.03); //Add items to ThermalLabel object... tLabel.Items.Add(txt); tLabel.Items.Add(bc); //Create data source... List <Product> products = new List <Product>(); products.Add(new Product("OO2935", "Olive Oil")); products.Add(new Product("CS4948", "Curry Sauce")); products.Add(new Product("CH0094", "Chocolate")); products.Add(new Product("MZ1027", "Mozzarella")); //set data source... tLabel.DataSource = products; return(tLabel); }
public BarcodeScannerPage(AddView addView) : base() { scannerView = new ZXingScannerView() { AutomationId = "zxingScannerView" }; scannerView.OnScanResult += async r => { scannerView.IsAnalyzing = false; scannerView.IsScanning = false; HttpClient httpClient = new HttpClient(); Uri uri = new Uri(string.Format("https://api.upcitemdb.com/prod/trial/lookup?upc={0}", r.Text)); HttpResponseMessage response = await httpClient.GetAsync(uri); Console.WriteLine("BarcodeScannerPage 31 got http response"); if (response.IsSuccessStatusCode) { JsonTextReader jsonTextReader = new JsonTextReader(new System.IO.StringReader(await response.Content.ReadAsStringAsync())); JsonSerializer jsonSerializer = new JsonSerializer(); BarcodeItem barcodeItem = jsonSerializer.Deserialize <BarcodeItem>(jsonTextReader); if (barcodeItem == null || barcodeItem.items.Length == 0) { Device.BeginInvokeOnMainThread(() => { ContentManager.pageController.ReturnToPrevious(); ContentManager.pageController.ShowAlert("Scan Result", "Unfortunately, the barcode cannot be found in the databse.", "Help Expanding Barcode Database", "Exit", null, null); }); return; } Device.BeginInvokeOnMainThread(async() => { var itemName = barcodeItem.items[0].title; ContentManager.pageController.ReturnToPrevious(); ContentManager.pageController.ShowAlert("Scan Result", "Item Name: " + barcodeItem.items[0].title, "Use", "Cancel", () => { addView.SetProductName(itemName); }, null); }); } }; scannerOverlay = new ZXingDefaultOverlay() { TopText = "Zesty scanner top text", BottomText = "Zesty scanner bottom text", ShowFlashButton = scannerView.HasTorch, AutomationId = "zxingDefaultOverlay" }; var grid = new Grid(); grid.Children.Add(scannerView); grid.Children.Add(scannerOverlay); Content = grid; }
// Delete the item public static void DeleteBarcodeItem(BarcodeItem barcodeItem) { foreach (BarcodeItem temp in Item.itemList) { if (temp.barcodeNumber.Equals(barcodeItem.barcodeNumber) && temp.barcodeType.Equals(barcodeItem.barcodeType)) { Item.itemList.Remove(temp); break; } } Item._itemList = itemList; Item.StoreData(Item.itemList); }
public static BarcodeItem UpdateCurrentItem(BarcodeItem barcodeItem) { List <BarcodeItem> tempList = Item.itemList; foreach (BarcodeItem temp in tempList) { if (temp.barcodeNumber.Equals(barcodeItem.barcodeNumber) && temp.barcodeType.Equals(barcodeItem.barcodeType)) { return(temp); } } // if not found we return what we were given return(barcodeItem); }
public static void PostBarcodeItem(collectorEntities1 DB, dynamic jsonItem) // Needs checked because barcodes add a 13 char { BarcodeItem item = new BarcodeItem() { Upc = jsonItem.upc, Ean = jsonItem.ean, Category = jsonItem.category, Brand = jsonItem.brand, Model = jsonItem.model, Manufacturer = jsonItem.manufacturer, Description = jsonItem.description, Title = jsonItem.title }; DB.BarcodeItems.Add(item); DB.SaveChanges(); }
private void GenerateThermalLabelWorker() { //Create the thermal label object ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 4, 3); //Define a TextItem object TextItem txtItem = new TextItem(0.2, 0.2, 3, 0.5, _productName); //font settings txtItem.Font.Name = "Arial"; txtItem.Font.Unit = FontUnit.Point; txtItem.Font.Size = 20; //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.2, 1, 3.6, 1.25, BarcodeSymbology.Code128, _productId); //Set bars height to .75inch bcItem.BarHeight = 0.75; //Set bars width to 0.02inch bcItem.BarWidth = 0.02; //font settings bcItem.Font.Name = "Arial"; bcItem.Font.Unit = FontUnit.Point; bcItem.Font.Size = 12; //border settings bcItem.BorderThickness = new FrameThickness(0.02); bcItem.CornerRadius = new RectangleCornerRadius(0.075); //center barcode inside its container bcItem.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //Add items to ThermalLabel object... tLabel.Items.Add(txtItem); tLabel.Items.Add(bcItem); //generate a pdf doc of the label using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { using (PrintJob pj = new PrintJob()) { pj.ExportToPdf(tLabel, ms, _dpi); } _buffer = ms.ToArray(); } }
public ThermalLabel GenerateInventoryLabel(string LineID, string jobname, string revDate) { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 2, 1); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txtItem = new TextItem(0.1, 0.19, 1.75, 0.125, "Job= " + jobname); txtItem.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontB; txtItem.Font.Unit = FontUnit.Point; txtItem.Font.Size = 7; txtItem.TextAlignment = TextAlignment.Left; TextItem txt2Item = new TextItem(0.1, 0.300, 1.75, 0.125, "Recv Date:" + revDate + "---"); txt2Item.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontB; txt2Item.Font.Unit = FontUnit.Point; txt2Item.Font.Size = 7; txt2Item.TextAlignment = TextAlignment.Left; //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.1, 0.45, 1.75, 0.375, BarcodeSymbology.Code39, LineID); bcItem.AddChecksum = false; bcItem.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontB; bcItem.Font.Unit = FontUnit.Point; bcItem.Font.Size = 7; bcItem.CodabarStopChar = CodabarStartStopChar.A; //Set bars height to .75inch bcItem.BarHeight = 0.375; //Set bars width to 0.0104inch bcItem.BarWidth = 0.0104; bcItem.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //Add items to ThermalLabel object... tLabel.Items.Add(bcItem); tLabel.Items.Add(txtItem); tLabel.Items.Add(txt2Item); return(tLabel); }
static void Main(string[] args) { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 1, 0.7); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txtItem = new TextItem(0.2, 0.2, 2.5, 0.5, "JANG"); //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.2, 1, 2, 1, BarcodeSymbology.Code128, "ABC 12345"); //Set bars height to .75inch bcItem.BarHeight = 0.75; //Set bars width to 0.0104inch bcItem.BarWidth = 0.0104; //Add items to ThermalLabel object... tLabel.Items.Add(txtItem); //tLabel.Items.Add(bcItem); //Create a WindowsPrintJob object WindowsPrintJob pj = new WindowsPrintJob(); pj.PrinterSettings = new PrinterSettings(); //Thermal Printer is connected through Serial Port pj.PrinterSettings.Communication.CommunicationType = CommunicationType.Serial; //Set Thermal Printer resolution pj.PrinterSettings.Dpi = 203; //Set Thermal Printer language pj.PrinterSettings.ProgrammingLanguage = ProgrammingLanguage.EPL; //Set Thermal Printer serial port settings pj.PrinterSettings.Communication.SerialPortName = "COM2"; pj.PrinterSettings.Communication.SerialPortBaudRate = 9600; pj.PrinterSettings.Communication.SerialPortDataBits = 8; pj.PrinterSettings.Communication.SerialPortStopBits = SerialPortStopBits.One; pj.PrinterSettings.Communication.SerialPortParity = SerialPortParity.None; pj.PrinterSettings.Communication.SerialPortFlowControl = SerialPortHandshake.None; //pj.PrinterSettings.PrinterName = "SEWOO Label Printer"; pj.Print(tLabel); Console.WriteLine("작업완료"); }
public Form1() { InitializeComponent(); //var tLabel = new ThermalLabel(UnitType.Mm, 76, 51); //tLabel.GapLength = 3; //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 4, 3); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txtItem = new TextItem(0.2, 0.2, 2.5, 0.5, "Thermal Label Test"); //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.2, 1, 2, 1, BarcodeSymbology.Code128, "ABC 12345"); //Set bars height to .75inch bcItem.BarHeight = 0.75; //Set bars width to 0.0104inch bcItem.BarWidth = 0.0104; //Add items to ThermalLabel object... tLabel.Items.Add(txtItem); tLabel.Items.Add(bcItem); //Create a PrintJob object using (PrintJob pj = new PrintJob()) { //Create PrinterSettings object PrinterSettings myPrinter = new PrinterSettings(); myPrinter.Communication.CommunicationType = CommunicationType.PrinterDriver; myPrinter.Dpi = 203; myPrinter.ProgrammingLanguage = ProgrammingLanguage.ZPL; myPrinter.PrinterName = "ZDesigner GT800 (EPL)"; //Set PrinterSettings to PrintJob pj.PrinterSettings = myPrinter; //Print ThermalLabel object... pj.Print(tLabel); } }
// Add or update and item and then save it public static void AddOrUpdate(BarcodeItem barcodeItem) { if (Item.ContainsBarcode(barcodeItem.barcodeNumber, barcodeItem.barcodeType)) { List <BarcodeItem> tempList = Item.itemList; foreach (BarcodeItem temp in tempList) { if (temp.barcodeNumber.Equals(barcodeItem.barcodeNumber) && temp.barcodeType.Equals(barcodeItem.barcodeType)) { temp.itemTitle = barcodeItem.itemTitle; temp.quantity = barcodeItem.quantity; } } } else { itemList.Add(barcodeItem); } Item._itemList = itemList; Item.StoreData(Item.itemList); }
private ThermalLabel GenerateThermalLabelDataMasking() { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 3, 2); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txt = new TextItem(0.1, 0.1, 2.8, 0.5, "MDL-001/X"); //set Mask info... txt.Mask = "%%%%ddd%%"; txt.MaskIncrement = "1%%"; //set font txt.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontA; txt.Font.Unit = FontUnit.Point; txt.Font.Size = 10; //Define a BarcodeItem object BarcodeItem bc = new BarcodeItem(0.1, 0.57, 2.8, 1.3, BarcodeSymbology.Code128, "PRD000-A"); //set Mask info... bc.Mask = "%%%d%%%A"; bc.MaskIncrement = "1%%%B"; //set barcode size bc.BarWidth = 0.02; bc.BarHeight = 0.75; //set barcode alignment bc.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //set font bc.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontA; bc.Font.Unit = FontUnit.Point; bc.Font.Size = 10; //Add items to ThermalLabel object... tLabel.Items.Add(txt); tLabel.Items.Add(bc); return(tLabel); }
public V2Label(string stockCode, string customerProductNo) : base(UnitType.Inch, 4.00, 1.50) { var stockCodeLabel = new TextItem(0.65, 1.22, 2.5, 0.5, stockCode.ToString()); stockCodeLabel.Font.Name = Font.NativePrinterFontB; stockCodeLabel.Font.Size = 10; var customerProductNoLabel = new TextItem(2.60, 1.22, 2.5, 0.5, customerProductNo.ToString()); customerProductNoLabel.Font.Name = Font.NativePrinterFontB; customerProductNoLabel.Font.Size = 10; var bcItemStockCode = new BarcodeItem(0.55, 0.25, 2.5, 0.9, BarcodeSymbology.Code128, stockCode.ToString()) { BarHeight = 0.80, //BarWidth = 0.0104, //Sizing = BarcodeSizing.FitProportional, //BarcodeAlignment = BarcodeAlignment.MiddleCenter, QuietZone = new FrameThickness(0), DisplayCode = false }; var bcCustomerProductNo = new BarcodeItem(2.40, 0.25, 2.5, 0.9, BarcodeSymbology.Code128, customerProductNo.ToString()) { BarHeight = 0.80, //BarWidth = 0.0104, //Sizing = BarcodeSizing.FitProportional, //BarcodeAlignment = BarcodeAlignment.MiddleCenter, QuietZone = new FrameThickness(0), DisplayCode = false }; //bcItemStockCode.Font.Size = 7; //bcCustomerProductNo.Font.Size = 7; this.Items.Add(stockCodeLabel); this.Items.Add(customerProductNoLabel); this.Items.Add(bcItemStockCode); this.Items.Add(bcCustomerProductNo); }
private ThermalLabel GenerateThermalLabelCounters() { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 3, 2); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txt = new TextItem(0.1, 0.1, 2.8, 0.5, "Decreasing 50"); //set counter step for decreasing by 1 txt.CounterStep = -1; //set font txt.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontA; txt.Font.Unit = FontUnit.Point; txt.Font.Size = 10; //Define a BarcodeItem object BarcodeItem bc = new BarcodeItem(0.1, 0.57, 2.8, 1.3, BarcodeSymbology.Code128, "ABC01"); //set counter step for increasing by 1 bc.CounterStep = 1; //set barcode size bc.BarWidth = 0.02; bc.BarHeight = 0.75; //set barcode alignment bc.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //set font bc.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontA; bc.Font.Unit = FontUnit.Point; bc.Font.Size = 10; //Add items to ThermalLabel object... tLabel.Items.Add(txt); tLabel.Items.Add(bc); return(tLabel); }
public V1Label(string customerProductNo, string description, string chassisNo, DateTime dispatchDate) : base(UnitType.Inch, 4.00, 1.50) { var customerProductNoValue = new TextItem(0.25, 0.20, 2.5, 0.5, customerProductNo.ToString()); customerProductNoValue.Font.Name = Font.NativePrinterFontB; customerProductNoValue.Font.Size = 17; var descriptionValue = new TextItem(0.25, 0.65, 2.4, 0.5, description); descriptionValue.Font.Name = Font.NativePrinterFontA; descriptionValue.Font.Size = 12; var chassisNoValue = new TextItem(0.25, 1.10, 2.5, 0.5, chassisNo.ToString()); chassisNoValue.Font.Name = Font.NativePrinterFontB; chassisNoValue.Font.Size = 17; var dispatchDateValue = new TextItem(2.53, 0.15, 2.5, 0.5, dispatchDate.ToString("dd/MM/yyy")); dispatchDateValue.Font.Name = Font.NativePrinterFontB; dispatchDateValue.Font.Size = 11; var bcItem = new BarcodeItem(2.77, 0.50, 2.5, 0.8, BarcodeSymbology.Code128, chassisNo.ToString()) { BarHeight = 0.80, //BarWidth = 0.0104, //Sizing = BarcodeSizing.FitProportional, //BarcodeAlignment = BarcodeAlignment.MiddleCenter, QuietZone = new FrameThickness(0), DisplayCode = false }; this.Items.Add(customerProductNoValue); this.Items.Add(descriptionValue); this.Items.Add(chassisNoValue); this.Items.Add(dispatchDateValue); this.Items.Add(bcItem); }
public string WaiverBarcodeGen(int waiverID) { using (VRArcadeDataAccessModel m = new VRArcadeDataAccessModel()) { VRWaiverLog vrWaiverLog = m.VRWaiverLogs.Where(x => x.ID == waiverID).FirstOrDefault(); if (vrWaiverLog != null) { int minutes = 0; string bookingRef = ""; if (vrWaiverLog.BookingReference != null && vrWaiverLog.BookingReference.IsTimedTiming) { minutes = vrWaiverLog.BookingReference.Duration; bookingRef = vrWaiverLog.BookingReference.Reference; } BarcodeItem bItem = new BarcodeItem() { IsPrintingTicket = true, Minutes = minutes, CustomerName = vrWaiverLog.FirstName + " " + vrWaiverLog.LastName, BookingReference = bookingRef, WaiverLogID = vrWaiverLog.ID }; BarcodeInfo bInfo = new BarcodeInfo(); bInfo.BarcodeItems.Add(bItem); GenerateBarcode(null, bInfo); } } return(""); }
private void radButtonPrintNow_Click(object sender, EventArgs e) { string question = "Are you sure you want to print (" + radSpinEditorNumPrint.Value.ToString() + ") " + (radRadioButtonTimed.CheckState == CheckState.Checked ? "TIMED" : "NON-TIMED") + " session ticket?"; if (radRadioButtonTimed.CheckState == radRadioButtonNonTimed.CheckState || radSpinEditorNumPrint.Value == 0) { this.ShowAlertBox("Barcode Generation", "Please make your choice!"); } else { DialogResult dr = RadMessageBox.Show(this, string.Format(question), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question); if (dr == DialogResult.Yes) { BarcodeInfo bInfo = new BarcodeInfo(); for (int i = 0; i < radSpinEditorNumPrint.Value; i++) { BarcodeItem bItem = new BarcodeItem() { IsPrintingTicket = true, Minutes = (radRadioButtonTimed.CheckState == CheckState.Checked ? (int)radSpinEditorSessionTime.Value : 0), CustomerName = "" }; bInfo.BarcodeItems.Add(bItem); } NetworkFunction.GenerateBarcode(bInfo); Close(); } } }
private string ParseFormat(BarcodeItem item) { if (item.FormattedData == null) { return(item.Text); } // TODO this can't be right. var format = item.FormattedData.ToString(); var result = new StringBuilder(); result.Append("\n"); if (format is BoardingPassDocument) { var boardingPass = (BoardingPassDocument)format; result.Append("Boarding Pass Document").Append("\n"); result.Append(boardingPass.Name).Append("\n"); foreach (BoardingPassLeg leg in boardingPass.Legs) { foreach (BoardingPassLegField field in leg.Fields) { result.Append(field.Type.Name()).Append(": ").Append(field.Value).Append("\n"); } } } else if (format is DEMedicalPlanDocument) { var medical = (DEMedicalPlanDocument)format; result.Append("DE Medical Plan Document").Append("\n"); result.Append("Doctor Fields: ").Append("\n"); foreach (DEMedicalPlanDoctorField field in medical.Doctor.Fields) { result.Append(field.Type.Name()).Append(": ").Append(field.Value).Append("\n"); } result.Append("\n"); result.Append("Patient Fields: ").Append("\n"); foreach (DEMedicalPlanPatientField field in medical.Patient.Fields) { result.Append(field.Type.Name()).Append(": ").Append(field.Value).Append("\n"); } result.Append("\n"); result.Append("Medicine Fields: ").Append("\n"); foreach (DEMedicalPlanStandardSubheading heading in medical.Subheadings) { foreach (DEMedicalPlanMedicine medicine in heading.Medicines) { foreach (DEMedicalPlanMedicineField field in medicine.Fields) { result.Append(field.Type.Name()).Append(": ").Append(field.Value).Append("\n"); } } } result.Append("\n"); } else if (format is DisabilityCertificateDocument) { result.Append("Disability Certificate Document").Append("\n"); foreach (DisabilityCertificateDocumentField field in ((DisabilityCertificateDocument)format).Fields) { result.Append(field.Type.Name()).Append(": ").Append(field.Value).Append("\n"); } } else if (format is SEPADocument) { result.Append("SEPA Document").Append("\n"); foreach (SEPADocumentField field in ((SEPADocument)format).Fields) { result.Append(field.Type.Name()).Append(": ").Append(field.Value).Append("\n"); } } else if (format is VCardDocument) { result.Append("VCard Document").Append("\n"); foreach (VCardDocumentField field in ((VCardDocument)format).Fields) { result.Append(field.Type.ToString()).Append(": ").Append(field.RawText).Append("\n"); } } return(result.ToString()); }
private ThermalLabel GenerateAdvancedThermalLabel() { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 4, 3); tLabel.GapLength = 0.2; //get ThermalLabel SDk install dir and get the sample images string imgFolder = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Neodynamic\\SDK\\ThermalLabel SDK 6.0 for .NET\\InstallDir").GetValue(null).ToString() + "\\Samples\\Images\\"; //Define an ImageItem for AdventureWorks logo ImageItem awLogo = new ImageItem(0.1, 0.1); awLogo.SourceFile = imgFolder + "adventureworks.jpg"; awLogo.Width = 1.5; awLogo.LockAspectRatio = LockAspectRatio.WidthBased; awLogo.MonochromeSettings.DitherMethod = DitherMethod.Threshold; awLogo.MonochromeSettings.Threshold = 80; //Define a TextItem for 'AW' id TextItem txtAW = new TextItem(2.8, 0.1, 1.1, 0.5, "AW"); //font settings txtAW.Font.Name = "Arial"; txtAW.Font.Bold = true; //stretch text txtAW.Sizing = TextSizing.Stretch; //border settings txtAW.BorderThickness = new FrameThickness(0.02); txtAW.CornerRadius = new RectangleCornerRadius(0.05); txtAW.TextPadding = new FrameThickness(0); //Define a TextItem for 'Model Name' TextItem txtModelName = new TextItem(0.1, 0.75, 3.8, 0.25, "Model Name: ROAD 150"); //font settings txtModelName.Font.Name = "Arial"; txtModelName.Font.Unit = FontUnit.Point; txtModelName.Font.Size = 12; //white text on black background txtModelName.BackColor = Neodynamic.SDK.Printing.Color.Black; txtModelName.ForeColor = Neodynamic.SDK.Printing.Color.White; //padding txtModelName.TextPadding = new FrameThickness(0.075, 0.03, 0, 0); //Define a TextItem for 'Model Code' (random code) TextItem txtModelCode = new TextItem(0.1, 1, 3.8, 0.25, "Model Code: " + Guid.NewGuid().ToString().ToUpper().Substring(0, 17)); //font settings txtModelCode.Font.Name = "Arial"; txtModelCode.Font.Unit = FontUnit.Point; txtModelCode.Font.Size = 12; //white text on black background txtModelCode.BackColor = Neodynamic.SDK.Printing.Color.Black; txtModelCode.ForeColor = Neodynamic.SDK.Printing.Color.White; //padding txtModelCode.TextPadding = new FrameThickness(0.075, 0.03, 0, 0); //Define a BarcodeItem for a random 'Serial Number' string serialNum = Guid.NewGuid().ToString().ToUpper().Substring(0, 8); BarcodeItem serialBarcode = new BarcodeItem(0.1, 1.25, 3.8, 0.5, BarcodeSymbology.Code39, serialNum); //Set bars height to .3inch serialBarcode.BarHeight = 0.3; //Set bars width to 0.02inch serialBarcode.BarWidth = 0.02; //disable checksum serialBarcode.AddChecksum = false; //hide human readable text serialBarcode.DisplayCode = false; //set border serialBarcode.BorderThickness = new FrameThickness(0.02); //align barcode serialBarcode.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //Define a TextItem for 'Serial Num' TextItem txtSN = new TextItem(0.1, 1.75 - serialBarcode.BorderThickness.Bottom, 1.25, 0.3, "S/N: " + serialNum); //font settings txtSN.Font.Name = "Arial Narrow"; txtSN.Font.Bold = true; txtSN.Font.Unit = FontUnit.Point; txtSN.Font.Size = 12; //padding txtSN.TextPadding = new FrameThickness(0.03); //set border txtSN.BorderThickness = new FrameThickness(0.02); txtSN.TextAlignment = TextAlignment.Center; //Define a TextItem for legend TextItem txtLegend = new TextItem(txtSN.X + txtSN.Width - txtSN.BorderThickness.Right, txtSN.Y, 3.8 - txtSN.Width + txtSN.BorderThickness.Right, txtSN.Height, "This bike is ridden by race winners! Brought to you by Adventure Works Cycles professional race team."); //font settings txtLegend.Font.Name = "Arial"; txtLegend.Font.Unit = FontUnit.Point; txtLegend.Font.Size = 7.5; //padding txtLegend.TextPadding = new FrameThickness(0.03, 0, 0, 0); //set border txtLegend.BorderThickness = new FrameThickness(0.02); //Define another BarcodeItem for EAN-13 symbology BarcodeItem eanBarcode = new BarcodeItem(0.1, 2.1, 3, 0.9, BarcodeSymbology.Ean13, "0729507704739"); //Set barcode dimensions... eanBarcode.BarHeight = 0.5; eanBarcode.BarWidth = 0.02; eanBarcode.EanUpcGuardBarHeight = 0.55; //human readable text font settings eanBarcode.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontA; eanBarcode.Font.Unit = FontUnit.Point; eanBarcode.Font.Size = 5; //Define an ImageItem for NBDA logo ImageItem nbdaLogo = new ImageItem(2.9, 2.1); nbdaLogo.SourceFile = imgFolder + "nbda.jpg"; nbdaLogo.Width = 1; nbdaLogo.LockAspectRatio = LockAspectRatio.WidthBased; nbdaLogo.MonochromeSettings.DitherMethod = DitherMethod.Threshold; nbdaLogo.MonochromeSettings.Threshold = 50; nbdaLogo.MonochromeSettings.ReverseEffect = true; //Define a LineShapeItem LineShapeItem line = new LineShapeItem(0.1, 2.8, 3.8, 0.03); line.Orientation = LineOrientation.Horizontal; line.StrokeThickness = 0.03; //Add items to ThermalLabel object... tLabel.Items.Add(awLogo); tLabel.Items.Add(txtAW); tLabel.Items.Add(txtModelName); tLabel.Items.Add(txtModelCode); tLabel.Items.Add(serialBarcode); tLabel.Items.Add(txtSN); tLabel.Items.Add(txtLegend); tLabel.Items.Add(eanBarcode); tLabel.Items.Add(nbdaLogo); tLabel.Items.Add(line); return(tLabel); }
protected void Button2_Click(object sender, EventArgs e) { //ThermalLabel tLabel = new ThermalLabel(Neodynamic.SDK.Printing.UnitType.Inch, 4, 3); //tLabel.GapLength = 0.2; ////Define a BarcodeItem object for encoding Code 39 symbology //BarcodeItem bc1 = new BarcodeItem(0.2, 0.2, 2, 1, BarcodeSymbology.Code39, "ABC123"); //bc1.AddChecksum = false; //bc1.CodeAlignment = BarcodeTextAlignment.BelowJustify; //bc1.BarWidth = 0.01; //bc1.BarHeight = 0.5; //bc1.QuietZone = new FrameThickness(0); //bc1.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //bc1.BorderThickness = new FrameThickness(0.03); ////A second Code 39 barcode with sizing = Fill //BarcodeItem bc2 = bc1.Clone() as BarcodeItem; //bc2.Y = 1.5; //bc2.BarcodePadding = new FrameThickness(0.1); //bc2.Sizing = BarcodeSizing.Fill; ////Add items to ThermalLabel object... //tLabel.Items.Add(bc1); //tLabel.Items.Add(bc2); ////Create a WindowsPrintJob object //WebPrintJob pj = new WebPrintJob(); // //Create PrinterSettings object // PrinterSettings myPrinter = new PrinterSettings(); // myPrinter.Communication.CommunicationType = CommunicationType.USB; // myPrinter.Dpi = 203; // myPrinter.ProgrammingLanguage = ProgrammingLanguage.ZPL; // myPrinter.PrinterName = "Zebra TLP2844-Z"; // ////Set PrinterSettings to WindowsPrintJob // pj.PrinterSettings = myPrinter; //////Print ThermalLabel object... ThermalLabel tLabel = new ThermalLabel(Neodynamic.SDK.Printing.UnitType.Inch, 4, 3); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txtItem = new TextItem(0.2, 0.2, 1, 0.5, "Thermal Label Test"); //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.2, 1, 2, 1, BarcodeSymbology.Code128, TextBox1.Text); //Set bars height to .75inch bcItem.BarHeight = 0.75; //Set bars width to 0.0104inch bcItem.BarWidth = 0.0104; //Add items to ThermalLabel object... //tLabel.Items.Add(txtItem); tLabel.Items.Add(bcItem); //Create a PrintJob object //using (WindowsPrintJob pj = new WindowsPrintJob()) //{ // //Create PrinterSettings object // PrinterSettings myPrinter = new PrinterSettings(); // myPrinter.Communication.CommunicationType = CommunicationType.USB; // myPrinter.Dpi = 203; // myPrinter.ProgrammingLanguage = ProgrammingLanguage.ZPL; // myPrinter.PrinterName = "Zebra TLP2844-Z"; // //Set PrinterSettings to WindowsPrintJob // pj.PrinterSettings = myPrinter; // //Print ThermalLabel object... // pj.Print(tLabel); //} using (PrintJob pj = new PrintJob()) { //Set number of copies pj.Copies = 5; //Save output to PDF... pj.ExportToPdf(tLabel, @"d:\develop\myLabels.pdf", 300); } }
public ThermalLabel GeneratePartLabel(string PartID, string partDescription) { //Define a ThermalLabel object and set unit to inch and label size ThermalLabel tLabel = new ThermalLabel(UnitType.Inch, 2, 1); tLabel.GapLength = 0.2; //Define a TextItem object TextItem txtItem = new TextItem(0.1, 0.25, 1.75, 0.25, "PN | " + PartID); txtItem.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontB; //txtItem.RotationAngle = 90; txtItem.Font.Unit = FontUnit.Point; txtItem.Font.Size = 10; txtItem.TextAlignment = TextAlignment.Center; //Define a TextItem object TextItem txt2 = new TextItem(0.03, 0.15, 1.9, 0.125, "DESIGN SYNTHESIS"); txt2.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontS; //txt2.RotationAngle = 90; txt2.Font.Unit = FontUnit.Point; txt2.Font.Size = 4; txt2.TextAlignment = TextAlignment.Center; //A simple vertical line LineShapeItem l3 = new LineShapeItem(1.85, 0.1, 0.01, 0.870); l3.StrokeThickness = 0.05; l3.Orientation = LineOrientation.Vertical; //A simple vertical line LineShapeItem l2 = new LineShapeItem(0.105, 0.1, 0.01, 0.870); l2.StrokeThickness = 0.05; l2.Orientation = LineOrientation.Vertical; //Define a BarcodeItem object BarcodeItem bcItem = new BarcodeItem(0.5, 0.4, 1.0, 0.5, BarcodeSymbology.Code39, PartID); bcItem.AddChecksum = false; bcItem.Font.Name = Neodynamic.SDK.Printing.Font.NativePrinterFontS; bcItem.Font.Unit = FontUnit.Point; bcItem.Font.Size = 4; bcItem.CodabarStopChar = CodabarStartStopChar.A; bcItem.BarHeight = 0.375; bcItem.BarWidth = 0.0104; bcItem.BarcodeAlignment = BarcodeAlignment.MiddleCenter; //Add items to ThermalLabel object... tLabel.Items.Add(bcItem); tLabel.Items.Add(txtItem); tLabel.Items.Add(txt2); tLabel.Items.Add(l3); tLabel.Items.Add(l2); return(tLabel); }
private void radButtonPrintTicket_Click(object sender, EventArgs e) { DialogResult dr = DialogResult.None; if (radListViewClientList.CheckedItems.Count > 0) { if (OptionSelectedValidate()) { if (!OptionTimeValidate()) { dr = RadMessageBox.Show(this, string.Format("One or more check-ins failed appointment time validation. Is the customer late or too early (e.g. Earlier than 60 minutes to game start)? " + Environment.NewLine + Environment.NewLine + " Do you want to override this error?", radListViewClientList.CheckedItems.Count), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question); } if (dr == DialogResult.None || dr == DialogResult.Yes) { dr = RadMessageBox.Show(this, string.Format("Are you sure you want to print ({0}) tickets?", radListViewClientList.CheckedItems.Count), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question); if (dr == DialogResult.Yes) { BarcodeInfo bInfo = new BarcodeInfo(); //List<WaiverInfo> listWaiverInfo = new List<WaiverInfo>(); foreach (ListViewDataItem item in radListViewClientList.CheckedItems) { ClientActionType cat = ((DataRowView)item.DataBoundItem)["Data"] as ClientActionType; string clientName = ((DataRowView)item.DataBoundItem)["ClientName"].ToString(); BarcodeItem bItem = new BarcodeItem() { IsPrintingTicket = true, Minutes = (cat.StartType == ClientActionType.ClientStartType.TIMED_START ? cat.Duration : 0), CustomerName = clientName, BookingReference = (string)((DataRowView)item.DataBoundItem)["Reference"], WaiverLogID = (int)((DataRowView)item.DataBoundItem)["ID"] }; bInfo.BarcodeItems.Add(bItem); /*listWaiverInfo.Add(new WaiverInfo() * { * ID = (int)((DataRowView)item.DataBoundItem)["ID"], * BookingReference = new BookingReference() * { * Reference = (string)((DataRowView)item.DataBoundItem)["Reference"] * } * * });*/ } //NetworkFunction.MarkWaiverReceived(listWaiverInfo); NetworkFunction.GenerateBarcode(bInfo); Close(); } } } else { this.ShowAlertBox("Waiver Process", "One or more selected item does not have option picked! Booking reference not found!"); } } else { this.ShowAlertBox("Waiver Process", "Please select at least one client to continue!"); } }