c# - 通过 LinePrinter API 将条码打印到 Intermec PB20

标签 c# windows-mobile

有谁知道如何从 Windows Compact Framework 应用程序将条码打印到 Intermec PB20 蓝牙打印机?我们目前正在使用 Intermec LinePrinter API,但无法找到打印条形码的方法。

最佳答案

谢谢大家的想法。直接打印到串行端口可能是最灵活的方法。在这种情况下,我们不想复制已经内置到 Intermec dll 中的所有工作,用于处理端口、打印机错误等。我们能够通过向打印机发送适当的代码将其切换到一种不同的模式,然后以这种方式传递直接打印机命令。

这是我们的解决方案,以防其他人在使用 Intermec 打印机时碰巧遇到类似问题。以下代码是不捕获打印机错误并重试等的测试用例。(参见 Intermec 代码示例。)

Intermec.Print.LinePrinter lp;

int escapeCharacter = int.Parse("1b", NumberStyles.HexNumber);
char[] toEzPrintMode = new char[] { Convert.ToChar(num2), 'E', 'Z' };

lp = new Intermec.Print.LinePrinter("Printer_Config.XML", "PrinterPB20_40COL");
lp.Open();

lp.Write(charArray2); //switch to ez print mode

string testBarcode = "{PRINT:@75,10:PD417,YDIM 6,XDIM 2,COLUMNS 2, SECURITY 3|ABCDEFGHIJKL|}";
lp.Write(testBarcode);

lp.Write("{LP}"); //switch from ez print mode back to line printer mode

lp.NewLine();
lp.Write("Test"); //verify line printer mode is working

在 Intermec 的支持网站上有一份称为“技术手册”的技术文档,其中描述了直接控制打印机的代码。关于 Easy Print 的部分描述了如何打印各种条码。

关于c# - 通过 LinePrinter API 将条码打印到 Intermec PB20,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26354/

相关文章:

windows-mobile - 如何在 Windows Mobile 中弹出键盘?

c++ - Windows Mobile 6.5 C++ - 确定互联网连接

visual-studio-2008 - 如何直接在Windows Mobile 上调试应用程序?

c# - 是否可以让 ReSharper 在我的解决方案的所有测试项目中只运行某个类别的测试?

c# - WPF 如何从 ViewModel 访问控件

c# - 在 Google BigQuery API 中,查询响应的默认超时是多少?

c# - 如何将解析后的aspx加载到字符串变量中

c# - 从设置为 ImageView 的相机捕获图像

css - Phonegap 使用 Windows Mobile 应用程序,如何在 CSS 文件中给出图像的完整路径?

c# - "Can' t 找到 PInvoke DLL 'sqlceme35.dll"