示例#1
0
        /// <summary>
        /// 打印三排的zpl指令,尺寸为30*20mm
        /// </summary>
        /// <param name="sb">完整的指令</param>
        /// <param name="materialNo">物料编号</param>
        /// <param name="branchNo">批次号</param>
        /// <param name="serialNo">流水号</param>
        /// <param name="separator">分割符</param>
        /// <param name="materialName">物料名称</param>
        /// <param name="productDrawNo">产品图号</param>
        private void Print3Col(StringBuilder sb, string materialNo, string branchNo, string serialNo, string separator, string materialName, string productDrawNo)
        {
            Font myfont = new Font("黑体", 12, FontStyle.Bold);

            string productDrawNoCN = UnicodeToZPL.UnCompressZPL(productDrawNo, "productDrawNo", myfont, TextDirection.零度);
            string materialNameCN  = UnicodeToZPL.UnCompressZPL(materialName, "materialName", myfont, TextDirection.零度);
            //string serialNoCN = UnicodeToZPL.UnCompressZPL(branchNoSerialNo, "branchNoSerialNo", myfont, TextDirection.零度);
            string branchNoSerialNo = branchNo + "-" + serialNo;            //批次号+序号
            string qrCode           = materialNo + separator + branchNo + separator + serialNo;

            sb.Append("^XA");
            sb.Append("^FO20,30^BQ,2,3^FDQA," + qrCode + "^FS");
            sb.Append("^FO95,40^A0,12,12^FD" + productDrawNoCN + "^FS");
            sb.Append("^FO95,70^A0,12,12^FD" + materialNameCN + "^FS");
            sb.Append("^FO95,100^A0,12,12^FD" + branchNoSerialNo + "^FS");
            sb.Append("^FO300,30^BQ,2,3^FDQA," + qrCode + "^FS");
            sb.Append("^FO385,40^A0,12,12^FD" + productDrawNoCN + "^FS");
            sb.Append("^FO385,70^A0,12,12^FD" + materialNameCN + "^FS");
            sb.Append("^FO385,100^A0,12,12^FD" + branchNoSerialNo + "^FS");
            sb.Append("^FO575,30^BQ,2,3^FDQA," + qrCode + "^FS");
            sb.Append("^FO655,40^A0,12,12^FD" + productDrawNoCN + "^FS");
            sb.Append("^FO655,70^A0,12,12^FD" + materialNameCN + "^FS");
            sb.Append("^FO655,100^A0,12,12^FD" + branchNoSerialNo + "^FS");
            sb.Append("^XZ");
        }
示例#2
0
        /// <summary>
        /// 打印单排的二维码,尺寸为60mm*40mm。
        /// </summary>
        /// <param name="sb">完整的指令</param>
        /// <param name="materialNo">物料编号</param>
        /// <param name="branchNo">批次号</param>
        /// <param name="serialNo">流水号</param>
        /// <param name="materialName">物料名称</param>
        /// <param name="productDrawNo">产品图号</param>
        private void Print1Col(StringBuilder sb, string materialNo, string branchNo, string serialNo, string separator, string materialName, string productDrawNo)
        {
            Font   myfont           = new Font("黑体", 17, FontStyle.Bold);
            string branchNoSerialNo = branchNo + "-" + serialNo;            //批次号+序号
            string productDrawNoCN  = UnicodeToZPL.UnCompressZPL(productDrawNo, "productDrawNo", myfont, TextDirection.零度);
            string materialNameCN   = UnicodeToZPL.UnCompressZPL(materialName, "materialName", myfont, TextDirection.零度);
            //string serialNoCN = UnicodeToZPL.UnCompressZPL(branchNoSerialNo, "branchNoSerialNo", myfont, TextDirection.零度);
            string qrCode = materialNo + separator + branchNo + separator + serialNo;

            sb.Append("^XA");
            sb.Append("^FO200,50,0^BQ,2,7^FDQA," + qrCode + "^FS");
            sb.Append("^FO450,75^A0,26,26^FDQA," + productDrawNoCN + "^FS");
            sb.Append("^FO450,105^A0,26,26^FDQA," + materialNameCN + "^FS");
            sb.Append("^FO450,135^A0,26,26^FD" + branchNoSerialNo + "^FS");
            sb.Append("^XZ");
        }