|
|
|
@ -129,6 +129,34 @@ namespace PrintBarCode.Business
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 打印小条码库位码方法
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void PrintSmallBarCodeInfo(SmallCodeInfo smallCodeInfo)
|
|
|
|
|
{
|
|
|
|
|
// 拼接成目标文件的完整路径
|
|
|
|
|
string path = Path.Combine(basePath, "templates", "smallTemplate.prn");
|
|
|
|
|
|
|
|
|
|
string[] args = new string[]
|
|
|
|
|
{
|
|
|
|
|
smallCodeInfo.QrCode,
|
|
|
|
|
smallCodeInfo.Text,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 将属性值用 "~" 连接起来,不带前缀
|
|
|
|
|
string TempStr = $"{smallCodeInfo.QrCode}~{smallCodeInfo.Text}";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string ZplStr = PrintH.GetPrintString(path, TempStr);//替换后字符串
|
|
|
|
|
|
|
|
|
|
bool pringFlag = zplp.SendStringToPrinter(debugConfig.PrintName, ZplStr);
|
|
|
|
|
if (pringFlag == false)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("打印错误,检查后请重新操作!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|