如何从 C# 打印到 Bluebird BIP-1300 热敏打印机?

问题描述 投票:0回答:3

我的应用程序在本地 CF 2.0 下运行,我想知道如何连接并发送一些内容以在 http://www.milliontech.com/home/content/view/195/95/'> 的嵌入式打印机中打印蓝鸟 BIP-1300 设备。

理想情况下我想要一个 C# 示例。

提前谢谢您。

c# embedded thermal-printer
3个回答
4
投票

使用bbpdaapi.dll(通过google搜索) 在 C# 中

using Bluebird.BIP.Printer;
...
this.prn1 = new Bluebird.BIP.Printer.Printer();
if (!this.prn1.Open(0))
            {
                MessageBox.Show("Can not open Printer", "Printer problem");
            }
this.prn1.PrintText("sdfgidfui", 0);
this.prn1.PrintBitmap(@"\My Documents\sample.bmp", 0);

if (this.prn1.WaitUntilPrintEnd() == 1)
{
MessageBox.Show("No paper in Printer", "Printer problem");
                }
            }
this.prn1.Close();

等等..


2
投票

我不熟悉这个特定的设备,但一般来说,此类打印机要求您发送 RAW 数据,因为它们没有 Windows 驱动程序。

这篇知识库文章概述了如何使用 C# 将数据发送到设备:这对您是否有用取决于所使用的非托管 API 在您的 CF 应用程序运行的环境中是否可用。

如果支持 API,您接下来需要的是设备的正确转义码,以便获得您想要的纸上结果。这些通常在打印机手册中有详细记录。

如果 Spooler API 不可用,或者您遇到其他问题,使这种方法变得麻烦而不值得,第三方 PrinterCE.NetCF SDK 也可能值得研究。


0
投票

问候,我知道这是一个老话题了。

是否有人拥有在 BIP1300 上运行的 .cab 应用程序,可以让我从输入字段打印文本?

© www.soinside.com 2019 - 2024. All rights reserved.