在C#中调用条码标签打印机中的动态链接库PPLA/PPLB(Argox)
来源:互联网 发布:doctype html js报错 编辑:程序博客网 时间:2024/05/20 04:26
以Argox条码机的PPLB为例,下面是相关的函数调用及打印代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace C5_Test
{
public partial class Form1 : Form
{
[DllImport("Winpplb.dll")]
private static extern int B_Bar2d_Maxi(int x, int y, int cl, int cc, int pc, string data);
[DllImport("Winpplb.dll")]
private static extern int B_Bar2d_PDF417(int x, int y, int w, int v, int s, int c, int px, int py, int r, int l, int t, int o, string data);
[DllImport("Winpplb.dll")]
private static extern int B_Bar2d_PDF417_N(int x, int y, int w, string para, string data);
[DllImport("Winpplb.dll")]
private static extern void B_ClosePrn();
[DllImport("Winpplb.dll")]
private static extern int B_CreatePrn(int selection, string filename);
[DllImport("Winpplb.dll")]
private static extern int B_Del_Form(string formname);
[DllImport("Winpplb.dll")]
private static extern int B_Del_Pcx(string pcxname);
[DllImport("Winpplb.dll")]
private static extern int B_Draw_Box(int x, int y, int thickness, int hor_dots, int ver_dots);
[DllImport("Winpplb.dll")]
private static extern int B_Draw_Line(char mode, int x, int y, int hor_dots, int ver_dots);
[DllImport("Winpplb.dll")]
private static extern int B_Error_Reporting(char option);
[DllImport("Winpplb.dll")]
private static extern int B_Get_DLL_VersionA(int nShowMessage);
[DllImport("Winpplb.dll")]
private static extern int B_Get_Graphic_ColorBMP(int x, int y, string filename);
[DllImport("Winpplb.dll")]
private static extern int B_Get_Pcx(int x, int y, string filename);
[DllImport("Winpplb.dll")]
private static extern int B_Initial_Setting(int Type, string Source);
[DllImport("Winpplb.dll")]
private static extern int B_Load_Pcx(int x, int y, string pcxname);
[DllImport("Winpplb.dll")]
private static extern int B_Open_ChineseFont(string path);
[DllImport("Winpplb.dll")]
private static extern int B_Print_Form(int labset, int copies, string form_out, string var);
[DllImport("Winpplb.dll")]
private static extern int B_Print_MCopy(int labset, int copies);
[DllImport("Winpplb.dll")]
private static extern int B_Print_Out(int labset);
[DllImport("Winpplb.dll")]
private static extern int B_Prn_Barcode(int x, int y, int ori, string type, int narrow, int width, int height, char human, string data);
[DllImport("Winpplb.dll")]
private static extern void B_Prn_Configuration();
[DllImport("Winpplb.dll")]
private static extern int B_Prn_Text(int x, int y, int ori, int font, int hor_factor, int ver_factor, char mode, string data);
[DllImport("Winpplb.dll")]
private static extern int B_Prn_Text_Chinese(int x, int y, int fonttype, string id_name, string data);
[DllImport("Winpplb.dll")]
private static extern int 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")]
private static extern int B_Prn_Text_TrueType_W(int x, int y, int FHeight, int FWidth, string FType, int Fspin, int FWeight,
int FItalic, int FUnline, int FStrikeOut, string id_name, string data);
[DllImport("Winpplb.dll")]
private static extern int B_Select_Option(int option);
[DllImport("Winpplb.dll")]
private static extern int B_Select_Symbol(int num_bit, int symbol, int country);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Backfeed(char option);
[DllImport("Winpplb.dll")]
private static extern int B_Set_BMPSave(int nSave, string strBMPFName);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Darkness(int darkness);
[DllImport("Winpplb.dll")]
private static extern int B_Set_DebugDialog(int nEnable);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Direction(char direction);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Form(string formfile);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Labgap(int lablength, int gaplength);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Labwidth(int labwidth);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Originpoint(int hor, int ver);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Prncomport(int baud, char parity, int data, int stop);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Prncomport_PC(int nBaudRate, int nByteSize, int nParity, int nStopBits, int nDsr, int nCts, int nXonXoff);
[DllImport("Winpplb.dll")]
private static extern int B_Set_Speed(int speed);
[DllImport("Winpplb.dll")]
private static extern int B_Set_ProcessDlg(int nShow);
[DllImport("Winpplb.dll")]
private static extern int B_GetUSBBufferLen();
[DllImport("Winpplb.dll")]
private static extern int B_EnumUSB(byte[] buf);
[DllImport("Winpplb.dll")]
private static extern int B_CreateUSBPort(int nPort);
[DllImport("Winpplb.dll")]
private static extern int B_ResetPrinter();
[DllImport("Winpplb.dll")]
private static extern int B_GetPrinterResponse(string pbuf, int nMax);
[DllImport("Winpplb.dll")]
private static extern int B_TFeedMode(int nMode);
[DllImport("Winpplb.dll")]
private static extern int B_TFeedTest();
[DllImport("Winpplb.dll")]
private static extern int B_CreatePort(int nPortType, int nPort, string filename);
[DllImport("Winpplb.dll")]
private static extern int B_Execute_Form(string form_out, string var);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//PPLBDLL Test code start
B_CreatePrn(0, null);
// USB Port Open
/*int nUSBDataLen;
byte[] pbuf;
nUSBDataLen = B_GetUSBBufferLen()+1;
pbuf = new byte[nUSBDataLen];
B_EnumUSB(pbuf);
B_CreateUSBPort(1);*/
// Open com3
//B_CreatePort(1, 3, null);
//B_Set_Darkness(8);
//B_Select_Option(1);
//B_Set_Labgap(50,24);
//B_Set_Labwidth(816);
//B_Set_Speed(2);
//B_Error_Reporting('S');
B_Prn_Text(100, 200, 0, 3, 1, 1, 'N', "FONT 3"); //Get a text string.
// B_Prn_Text(200,10,1,3,1,1,'N',"Text 3<+1>");
B_Prn_Barcode(20, 20, 0, "1", 3, 3, 75, 'B', "079-305"); //Get a bar code.
//Get a PDF-417 2D bar code.
//B_Bar2d_PDF417(50, 150, 400, 300, 0, 0, 3, 7, 10, 2, 0, 0, "ARGOXINFO");
//Get a Maxi Code 2D bar code.
B_Bar2d_Maxi(400, 10, 300, 400, 93065, "This MaxiCode");
B_Draw_Line('E', 380, 200, 100, 10); //Line Draw by Exclusive or operation.
//B_Draw_Line('O', 400, 180, 10, 100); //Line draw by or operation.
//B_Draw_Line('W', 380, 220, 100, 10); //Draw white line.
//B_Draw_Line('E', 450, 180, 20, 110); //Line Draw by Exclusive or operation.
//B_Draw_Box(0, 0, 5, 815, 300); //Draw a box.
// B_Get_Pcx(50,55,"phone.pcx"); //Print Graphics of .PCX.
//B_Get_Pcx(400,0,"test1.pcx");
B_Prn_Text_TrueType(450, 20, 40, "Times New Roman", 1, 400, 0, 0, 0, "AA", "Library Test");
// Get a truetype text
//B_Prn_Text_TrueType(30,50,20,"Arial",4,400,0,0,0,"AB","TrueType Font");
B_Print_Out(1);
B_ClosePrn();
//PPLBDLL Test code end
}
}
}
本文转自:http://www.lesain.com/fwzc/tiaomazhishi/BarocdeTechnology/C_PPLB.html
- 在C#中调用条码标签打印机中的动态链接库PPLA/PPLB(Argox)
- 在Delphi中怎样调用立象(Argox)条码打印机动态库PPLA/PPLB(DLL)
- ARGOX CP-2140 如何把PPLB改为PPLA
- 在SQL中调用动态链接库中的函数
- 在VS2012中调用动态链接库
- PPLB条码打印
- argox打码机的pplb指令开发
- C# 中动态调用C++动态链接
- C# 中动态调用C++动态链接
- 在C#中调用C语言写的动态链接库 DLL
- C#调用动态链接库
- C# 调用动态链接库
- C#调用动态链接库
- C#调用动态链接库
- C#调用动态链接库
- c#中如何调用vc++写的动态链接库
- C#中如何调用动态链接库DLL(转)
- C#中如何调用动态链接库DLL
- 确定想要去的企业类型,然后学习进入所需要的技能
- MFC中的CEdit与CRichEdit使用技巧
- VRML与.wrl
- 传智播客——老毕说万物皆对象
- 连连看外挂制作 —— 模拟键鼠( 3 )
- 在C#中调用条码标签打印机中的动态链接库PPLA/PPLB(Argox)
- 别把自己当成被剥削者,要把自己当成股东去工作
- 几种建立http-tunnel的方法
- wince安装顺序
- 一不小心被鱼肉一把
- 在oracle Linux上安装audacious
- 很高兴加入了这个大家庭
- 游戏汉化
- mysql备份和恢复