【问题标题】:Brother QL printer SDK - do not print, nothing happens (QL-710W)Brother QL 打印机 SDK - 不打印,没有任何反应 (QL-710W)
【发布时间】:2015-07-17 21:05:33
【问题描述】:

我想用 C# 编写应用程序,我希望我的 Brother QL-710W 从我的应用程序打印标签。我从 Brother 的网站下载了示例 SDK 代码,但它不起作用。我按下打印按钮,加载光标显示,没有任何反应。打印机不打印。这是代码:

private void button1_Click(object sender, EventArgs e) {
    bpac.DocumentClass doc = new DocumentClass();

    if (doc.Open("testtpl.lbx")) {
        doc.GetObject("IDName").Text = txtIDName.Text;
        doc.GetObject("IDNum").Text = txtIDNum.Text;

        doc.StartPrint("", PrintOptionConstants.bpoDefault);
        doc.PrintOut(1, PrintOptionConstants.bpoDefault);
        doc.EndPrint();
        doc.Close();
    } else {
        MessageBox.Show("Open() Error: " + doc.ErrorCode);
    }
}

从 P-Touch Editor 中完美打印所有内容。

Windows 8.1 专业版、Visual Studio 2013

【问题讨论】:

  • 是的。在 Windows 32 位上一切正常,在 64 位上 - 不。我认为兄弟驱动问题
  • 即使在 2021 年,64 位版本似乎仍然存在问题!

标签: c# printing


【解决方案1】:

我对这个问题的解决方案来自多个答案,看来您需要安装 Brother 的 32 位和 64 位驱动程序,然后在您的项目中添加对“interop.bpac”的 32 位版本的引用。然后在你项目的“属性”->“构建”下,将目标设置为 x86

【讨论】:

    【解决方案2】:

    我找到了解决方案。如果操作系统是 64 位或 32 位实际上并不重要。重要的是应用程序是针对 64 位还是 32 位编译的。所以在我的例子中,应用程序是 32 位的,安装 32 位版本的 b-PAC SDK 解决了这个问题。

    【讨论】:

    • 使用 32 位版本的 SDK 也对我有用。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2019-08-26
    • 1970-01-01
    • 1970-01-01
    • 2016-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-22
    相关资源
    最近更新 更多