立象条码打印机PPLB类单双标签打印

mac2022-06-30  122

园里的条码打印,都是Zebra机的。立象机的,还没有,我算是首发吧,呵呵。

简单说明一下,市场上条码打印机,大致分单标签和双标签打印机,至少我见到的是这样,还有没三个、四个的就不清楚了。

Code using System;using System.Runtime.InteropServices;using System.Collections.Generic;using System.Text;namespace Kurodo.Printer{    public class Printer    {        [DllImport("WINPPLb.DLL", EntryPoint = "B_Set_Darkness")]        public static extern void B_Set_Darkness(int darkness);        [DllImport("WINPPLb.DLL", EntryPoint = "B_CreatePrn")]        public static extern void B_CreatePrn(int selection, string FileName);        [DllImport("WINPPLb.DLL", EntryPoint = "B_Print_Out")]        public static extern void B_Print_Out(int copypiece);        [DllImport("WINPPLb.DLL", EntryPoint = "B_Prn_Text")]        public static extern void B_Prn_Text(int x, int y, int ori, int font, int hor_factor, int ver_factor, char mode, string data);        [DllImport("WINPPLb.DLL", EntryPoint = "B_Prn_Barcode")]        public static extern void B_Prn_Barcode(int x, int y, int ori, string typee, int narrow, int width, int height, char human, string data);        [DllImport("WINPPLb.DLL", EntryPoint = "B_Prn_Text_TrueType")]        public static extern void B_Prn_Text_TrueType(int x, int y, int FSize, string FType, int Fspin, int FWeight, int FItalic, int FUnline, int FStrikeOut, string id_name, string data);        [DllImport("WINPPLb.DLL", EntryPoint = "B_Get_Pcx")]        public static extern void B_Get_Pcx(int x, int y, string filename);        [DllImport("WINPPLb.dll", EntryPoint = "B_ClosePrn")]        public static extern void B_ClosePrn();        public Printer()        {        }        public static void SingleList(string name, string code, string size, string price)        {            B_CreatePrn(1"PPLB_A.txt");            B_Set_Darkness(14);            B_Prn_Text_TrueType(1403540"宋体"1100000"namel", name);            B_Prn_Barcode(70800"1"2240'b', code);            B_Prn_Text_TrueType(5015040"宋体"170000"sizel""尺码:" + size);            B_Prn_Text_TrueType(23015040"宋体"170000"pricel""售价:" + price);            B_Print_Out(1);            B_ClosePrn();        }        public static void LeftPoint(string name, string code, string size, string price)        {            B_CreatePrn(1"PPLB_B.txt");            B_Set_Darkness(14);            B_Prn_Text_TrueType(1403540"宋体"1100000"namel", name);            B_Prn_Barcode(70800"1"2240'b', code);            B_Prn_Text_TrueType(5015040"宋体"170000"sizel""尺码:" + size);            B_Prn_Text_TrueType(23015040"宋体"170000"pricel""售价:" + price);        }        public static void RightPoint(string name, string code, string size, string price)        {            B_Prn_Text_TrueType(5403540"宋体"1100000"namer", name);            B_Prn_Barcode(470800"1"2240'b', code);            B_Prn_Text_TrueType(45015040"宋体"170000"sizer""尺码:" + size);            B_Prn_Text_TrueType(63015040"宋体"170000"pricer""售价:" + price);        }        public static void ClosePoint()        {            B_Print_Out(1);            B_ClosePrn();        }        public static void DuallList(PrintList[] Pl)        {            for (int i = 0; i < Pl.Length; i++)            {                for (int j = 1; j <= Pl[i].Total; j += 2)                {                    Printer.LeftPoint("左边标签", Pl[i].BarCode, Pl[i].Size, Pl[i].Price);                    if (j + 1 < Pl[i].Total)                    {                        Printer.RightPoint("右边标签", Pl[i].BarCode, Pl[i].Size, Pl[i].Price);                    }                    Printer.ClosePoint();                }            }        }    }}

转载于:https://www.cnblogs.com/Kurodo/archive/2009/04/01/1426836.html

相关资源:立象os-214plus二次开发库及中文文档
最新回复(0)