创建项目
首先說一下,本文章是借鉴了其他大佬的文章,然后我记录一下的文章。
首先创建好一个.net framework的winform项目。
这里面主要用到两个库文件:
Fnthex32.dll、LabelPrint.dll。
Fnthex32这个有8位参数和9位参数的,我这里用9位参数。
如果下载资源要付费,请留下评论。
这只是一个demo,展示一下斑马打印机的一个打印中文的方法。
连接打印机方式多样,请按需调整。
开始
[DllImport("Fnthex32.dll")]
private static extern int GETFONTHEX(
string text,//文本
string fontName,//字体
string tempName,//临时变量
int orient,//方向
int height,//字体高度
int width,//字体宽度
int isBold,//是否加粗0,1
int isItalic,//是否斜体0,1
StringBuilder cmd);//内容
private static string printName = string.Empty;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e<