public void PrintLabelQRCode(WMS.LabelItem labelItem, int Prints) { if (!ConnectPrinter()) { return; } int multiplier = 1; // 203 DPI : 1mm is about 7.99 dots // 300 DPI : 1mm is about 11.81 dots // 600 DPI : 1mm is about 23.62 dots int resolution = BXLLApi.GetPrinterDPI(); int dotsPer1mm = (int)Math.Round((float)resolution / 25.4f); if (resolution >= 600) { multiplier = 3; } SendPrinterSettingCommand(); // Prints string using TrueFont // P1 : Horizontal position (X) [dot] // P2 : Vertical position (Y) [dot] // P3 : Font Name // P4 : Font Size // P5 : Rotation : (0 : 0 degree , 1 : 90 degree, 2 : 180 degree, 3 : 270 degree) // P6 : Italic // P7 : Bold // P8 : Underline // P9 : RLE (Run-length encoding) //BXLLApi.PrintTrueFontLib(2 * dotsPer1mm, 5 * dotsPer1mm, "Arial", 14, 0, true, true, false, "Sample Label-1", false); // BXLLApi.PrintTrueFont(2 * dotsPer1mm, 5 * dotsPer1mm, "Arial", 14, 0, true, true, false, "Sample Label-1", false); // Draw Lines BXLLApi.PrintBlock(1 * dotsPer1mm, 8 * dotsPer1mm, 45 * dotsPer1mm, 9 * dotsPer1mm, (int)SLCS_BLOCK_OPTION.LINE_OVER_WRITING, 0); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 10 * dotsPer1mm, "Arial", 32, 0, false, true, false, "Purchasing code: " + labelItem.PurchasingCode, false); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 15 * dotsPer1mm, "Arial", 32, 0, false, true, false, "Material Code: " + labelItem.MaterialCode, false); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 20 * dotsPer1mm, "Arial", 32, 0, false, true, false, "Commodity: " + labelItem.Commodity, false); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 25 * dotsPer1mm, "Arial", 32, 0, false, true, false, "Quantity: " + labelItem.Quantity, false); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 30 * dotsPer1mm, "Arial", 32, 0, false, true, false, "Expiry Date: " + labelItem.ExpiryDate.ToString("dd/MM/yyyy"), false); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 35 * dotsPer1mm, "Arial", 32, 0, false, true, false, "LOT/PO: " + labelItem.LotPo, false); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 40 * dotsPer1mm, "Arial", 32, 0, false, true, false, "Invoice: " + labelItem.Invoice, false); string QRCode_data = "s" + labelItem.PurchasingCode + ";" + labelItem.MaterialCode + ";" + labelItem.Quantity + ";" + labelItem.ExpiryDate.ToString("dd/MM/yyyy") + ";" + labelItem.LotPo + ";" + labelItem.Invoice + "e"; BXLLApi.PrintQRCode(54 * dotsPer1mm, 18 * dotsPer1mm, (int)SLCS_QRCODE_MODEL.QRMODEL_2, (int)SLCS_QRCODE_ECC_LEVEL.QRECCLEVEL_H, (int)SLCS_QRCODE_SIZE.QRSIZE_8, (int)SLCS_ROTATION.ROTATE_0, QRCode_data); BXLLApi.PrintBlock(1 * dotsPer1mm, 44 * dotsPer1mm, 45 * dotsPer1mm, 45 * dotsPer1mm, (int)SLCS_BLOCK_OPTION.LINE_OVER_WRITING, 0); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 47 * dotsPer1mm, "Arial", 32, 0, false, true, false, "Remark:", false); // Print Command BXLLApi.Prints(1, Prints); // Disconnect printer BXLLApi.DisconnectPrinter(); }
public bool PrintQRCodeWarehouse(WMS.Model.WarehouseInfor infor) { try { if (!ConnectPrinter()) { return(false); } int multiplier = 1; // 203 DPI : 1mm is about 7.99 dots // 300 DPI : 1mm is about 11.81 dots // 600 DPI : 1mm is about 23.62 dots int resolution = BXLLApi.GetPrinterDPI(); int dotsPer1mm = (int)Math.Round((float)resolution / 25.4f); if (resolution >= 600) { multiplier = 3; } SendPrinterSettingCommand(); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 3 * dotsPer1mm, "Arial", 24, 0, true, true, false, "Warehouse: " + infor.Warehouse, false); BXLLApi.PrintBlock(1 * dotsPer1mm, 6 * dotsPer1mm, 45 * dotsPer1mm, 7 * dotsPer1mm, (int)SLCS_BLOCK_OPTION.LINE_OVER_WRITING, 0); BXLLApi.PrintDeviceFont(6 * dotsPer1mm, 10 * dotsPer1mm, (int)SLCS_DEVICE_FONT.ENG_24X38, multiplier, multiplier, (int)SLCS_ROTATION.ROTATE_0, false, "Material: " + infor.Material); BXLLApi.PrintDeviceFont(6 * dotsPer1mm, 14 * dotsPer1mm, (int)SLCS_DEVICE_FONT.ENG_24X38, multiplier, multiplier, (int)SLCS_ROTATION.ROTATE_0, false, "Lot: " + infor.Lot); BXLLApi.PrintDeviceFont(6 * dotsPer1mm, 18 * dotsPer1mm, (int)SLCS_DEVICE_FONT.ENG_24X38, multiplier, multiplier, (int)SLCS_ROTATION.ROTATE_0, false, "Quantity: " + infor.quantity.ToString("N3") + " " + infor.Unit); BXLLApi.PrintDeviceFont(6 * dotsPer1mm, 22 * dotsPer1mm, (int)SLCS_DEVICE_FONT.ENG_24X38, multiplier, multiplier, (int)SLCS_ROTATION.ROTATE_0, false, "Expiry Date: " + infor.expiryDate.ToString("dd/MM/yyyy")); string QRCode_data = infor.Warehouse + ";" + infor.Material + ";" + infor.Lot + ";" + infor.quantity + ";" + infor.ImportDate.ToString("ddMMyyyy") + ";" + infor.expiryDate.ToString("ddMMyyyy"); BXLLApi.PrintQRCode(47 * dotsPer1mm, 25 * dotsPer1mm, (int)SLCS_QRCODE_MODEL.QRMODEL_2, (int)SLCS_QRCODE_ECC_LEVEL.QRECCLEVEL_H, (int)SLCS_QRCODE_SIZE.QRSIZE_9, (int)SLCS_ROTATION.ROTATE_0, QRCode_data); // Print Command BXLLApi.Prints(1, 1); // Disconnect printer BXLLApi.DisconnectPrinter(); return(true); } catch (Exception ex) { SystemLog.Output(SystemLog.MSG_TYPE.Err, "print label fail", ex.Message); return(false); } }
public bool PrintQRCodePQCOUt(string stingQR, string warehouse) { try { if (!ConnectPrinter()) { return(false); } int multiplier = 1; // 203 DPI : 1mm is about 7.99 dots // 300 DPI : 1mm is about 11.81 dots // 600 DPI : 1mm is about 23.62 dots int resolution = BXLLApi.GetPrinterDPI(); int dotsPer1mm = (int)Math.Round((float)resolution / 25.4f); if (resolution >= 600) { multiplier = 3; } SendPrinterSettingCommand(); BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 5 * dotsPer1mm, "Arial", 24, 0, true, true, false, "Import Finished Goods: " + warehouse, false); BXLLApi.PrintBlock(1 * dotsPer1mm, 13 * dotsPer1mm, 75 * dotsPer1mm, 14 * dotsPer1mm, (int)SLCS_BLOCK_OPTION.LINE_OVER_WRITING, 0); BXLLApi.PrintDeviceFont(6 * dotsPer1mm, 17 * dotsPer1mm, (int)SLCS_DEVICE_FONT.ENG_37X58, multiplier, multiplier, (int)SLCS_ROTATION.ROTATE_0, false, "QR code: " + stingQR); string QRCode_data = stingQR; BXLLApi.PrintQRCode(30 * dotsPer1mm, 25 * dotsPer1mm, (int)SLCS_QRCODE_MODEL.QRMODEL_2, (int)SLCS_QRCODE_ECC_LEVEL.QRECCLEVEL_H, (int)SLCS_QRCODE_SIZE.QRSIZE_9, (int)SLCS_ROTATION.ROTATE_0, QRCode_data); // Print Command BXLLApi.Prints(1, 1); // Disconnect printer BXLLApi.DisconnectPrinter(); return(true); } catch (Exception ex) { SystemLog.Output(SystemLog.MSG_TYPE.Err, "print label fail", ex.Message); return(false); } }
public void PrintQRCode(string stingQR, string name) { if (!ConnectPrinter()) { return; } int multiplier = 1; // 203 DPI : 1mm is about 7.99 dots // 300 DPI : 1mm is about 11.81 dots // 600 DPI : 1mm is about 23.62 dots int resolution = BXLLApi.GetPrinterDPI(); int dotsPer1mm = (int)Math.Round((float)resolution / 25.4f); if (resolution >= 600) { multiplier = 3; } SendPrinterSettingCommand(); // Prints string using TrueFont // P1 : Horizontal position (X) [dot] // P2 : Vertical position (Y) [dot] // P3 : Font Name // P4 : Font Size // P5 : Rotation : (0 : 0 degree , 1 : 90 degree, 2 : 180 degree, 3 : 270 degree) // P6 : Italic // P7 : Bold // P8 : Underline // P9 : RLE (Run-length encoding) //BXLLApi.PrintTrueFontLib(2 * dotsPer1mm, 5 * dotsPer1mm, "Arial", 14, 0, true, true, false, "Sample Label-1", false); // BXLLApi.PrintTrueFont(2 * dotsPer1mm, 5 * dotsPer1mm, "Arial", 14, 0, true, true, false, "Sample Label-1", false); // Draw Lines // BXLLApi.PrintBlock(1 * dotsPer1mm, 8 * dotsPer1mm, 75 * dotsPer1mm, 9 * dotsPer1mm, (int)SLCS_BLOCK_OPTION.LINE_OVER_WRITING, 0); //Print string using Vector Font // P1 : Horizontal position (X) [dot] // P2 : Vertical position (Y) [dot] // P3 : Font selection // U: ASCII (1Byte code) // K: KS5601 (2Byte code) // B: BIG5 (2Byte code) // G: GB2312 (2Byte code) // J: Shift-JIS (2Byte code) // P4 : Font width (W)[dot] // P5 : Font height (H)[dot] // P6 : Right-side character spacing [dot], Plus (+)/Minus (-) option can be used. Ex) 5, +3, -10 // P7 : Bold // P8 : Reverse printing // P9 : Text style (N : Normal, I : Italic) // P10 : Rotation (0 ~ 3) // P11 : Text Alignment // L: Left // R: Right // C: Center // P12 : Text string write direction (0 : left to right, 1 : right to left) // P13 : data to print // ※ : Third parameter, 'ASCII' must be set if Bixolon printer is SLP-T400, SLP-T403, SRP-770 and SRP-770II. BXLLApi.PrintTrueFontW(2 * dotsPer1mm, 5 * dotsPer1mm, "Arial", 24, 0, true, true, false, "WAREHOUSE: " + name, false); BXLLApi.PrintBlock(1 * dotsPer1mm, 13 * dotsPer1mm, 75 * dotsPer1mm, 14 * dotsPer1mm, (int)SLCS_BLOCK_OPTION.LINE_OVER_WRITING, 0); BXLLApi.PrintDeviceFont(6 * dotsPer1mm, 17 * dotsPer1mm, (int)SLCS_DEVICE_FONT.ENG_37X58, multiplier, multiplier, (int)SLCS_ROTATION.ROTATE_0, false, "Location: " + stingQR); string QRCode_data = "s" + stingQR + "e"; BXLLApi.PrintQRCode(30 * dotsPer1mm, 25 * dotsPer1mm, (int)SLCS_QRCODE_MODEL.QRMODEL_2, (int)SLCS_QRCODE_ECC_LEVEL.QRECCLEVEL_H, (int)SLCS_QRCODE_SIZE.QRSIZE_9, (int)SLCS_ROTATION.ROTATE_0, QRCode_data); // Print Command BXLLApi.Prints(1, 1); // Disconnect printer BXLLApi.DisconnectPrinter(); }