简体   繁体   中英

Brother QL printer SDK - do not print, nothing happens (QL-710W)

I want to write application with C#, and I want that my Brother QL-710W to print labels from my app. I downloaded the sample SDK code from Brother's website, but it does not work. I press the Print button, the loading cursor shows and nothing happens. The printer does not print. Here is code:

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);
    }
}

From the P-Touch Editor all prints perfectly.

Windows 8.1 Pro, Visual Studio 2013

I found a solution. If the OS is 64bit or 32bit actually doesn't matter. What matters is if the application was compiled for 64 or 32bit. So in my case, the application was 32bit and installing the 32bit version of the b-PAC SDK solved the problem.

My solution for this issue came from a combination of answers, it seems you need to install both 32 and 64 bit drivers of bPac from Brother, then add a reference to the 32bit version of "interop.bpac" in your project. Then under your project's 'Properties -> "Build", set the target to x86 平台目标

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM