Brother QL 打印机 SDK - 不打印,没有任何反应 (QL-710W)
Brother QL printer SDK - do not print, nothing happens (QL-710W)
我想用 C# 编写应用程序,我希望我的兄弟 QL-710W 从我的应用程序打印标签。我从Brother的网站上下载了sample 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
我找到了解决办法。如果 OS 是 64 位或 32 位实际上并不重要。重要的是应用程序是为 64 位还是 32 位编译的。所以在我的例子中,应用程序是 32 位的,安装 32 位版本的 b-PAC SDK 解决了这个问题。
我对这个问题的解决方案来自综合答案,看来你需要安装 Brother 的 bPac 的 32 位和 64 位驱动程序,然后添加对“interop.bpac”的 32 位版本的引用在你的项目中。然后在项目的“属性”->“构建”下,将目标设置为 x86
我想用 C# 编写应用程序,我希望我的兄弟 QL-710W 从我的应用程序打印标签。我从Brother的网站上下载了sample 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
我找到了解决办法。如果 OS 是 64 位或 32 位实际上并不重要。重要的是应用程序是为 64 位还是 32 位编译的。所以在我的例子中,应用程序是 32 位的,安装 32 位版本的 b-PAC SDK 解决了这个问题。
我对这个问题的解决方案来自综合答案,看来你需要安装 Brother 的 bPac 的 32 位和 64 位驱动程序,然后添加对“interop.bpac”的 32 位版本的引用在你的项目中。然后在项目的“属性”->“构建”下,将目标设置为 x86