0

I need to print a label from a Brother P-Touch 9800 series label printer that is attached via USB.

I'm using the example project included with the SDK, so there shouldn't be any problems with the code itself, yet it won't print. No error messages of any kind, it doesn't stall or crash, it simply doesn't print. The Bpac reference has been included and is being included with 'using bpac'.

        bpac.DocumentClass doc = new DocumentClass();
        if (doc.Open(templatePath) != false)
        {
            //doc.SetBarcodeData(123, "asd");
            doc.GetObject("objCompany").Text = txtCompany.Text;
            doc.GetObject("objName").Text = txtName.Text;

            Console.WriteLine(doc.GetObject("objName").Text);
            Console.WriteLine(doc.GetObject("objCompany").Text);

            // doc.SetMediaById(doc.Printer.GetMediaId(), true);
            doc.DoPrint(0, "0");
            doc.StartPrint("asdasd", PrintOptionConstants.bpoDefault);
            doc.PrintOut(1, PrintOptionConstants.bpoDefault);
            doc.EndPrint();
            doc.Close();
        }

I've tried printing from the regular editor which works just fine, so the computer has a connection and the printer works.

Anyone have any suggestions or know what the problem could be?

Kagemand Andersen
  • 1,470
  • 2
  • 16
  • 30

2 Answers2

1

In case anyone's wondering or run into this problem in the future, I found the solution to this.

The problem was the driver. Apparently the 64-bit drivers doesn't work properly. Why? I don't know. I installed the 32-bit drivers and it worked immediately.

Kagemand Andersen
  • 1,470
  • 2
  • 16
  • 30
  • How can you install the 32bit drivers on a 64 bit system? oO – LueTm Jan 07 '16 at 13:27
  • I had the same problem. I suppose the solution was using 64bit driver and sdk dll, but building x86 in visual studio worked. See: [Label printing development using b-pac SDK in a C# application](http://stackoverflow.com/questions/11166063/label-printing-development-using-b-pac-sdk-in-a-c-sharp-application) – Repeat Spacer Feb 05 '16 at 11:19
  • how can I use custome p-touch template files with label printer? – Tariq Feb 19 '16 at 22:20
0

I had the same problem and I've figured out that it's faulty driver.

Install a new driver and click "Windows update". Now there are different QL Drivers. Some from Brother and some from Microsoft. I tried the Microsoft one and now it prints the document with the same code.

Mihai Dinculescu
  • 19,743
  • 8
  • 55
  • 70
Andreas
  • 9
  • 1
  • 4
  • I'm not sure what you mean. Where are you getting Microsoft drivers for a label printer? – Kagemand Andersen Dec 16 '14 at 16:32
  • go to the page of the Printer settings where you can install a new Driver. Now there is a Dialog where you can click "Windows update". Windows Looks for new Drivers, after that you should see two different ql550 or p-touch Drivers in your case - one from Brother itself, the other from Microsoft. I installed the MS one and all was fine. – Andreas Dec 16 '14 at 16:42
  • Do you mean the 'Update driver software' in Device Manager? If so, then it just tells me that I already have the best driver installed. If I check the list of compatible drivers it only shows the driver from Brother. – Kagemand Andersen Dec 16 '14 at 16:54
  • Ah, I see what you mean now. Unfortunately when I update no 9800PCN drivers show up at all. – Kagemand Andersen Dec 16 '14 at 17:35