0
votes

I am developing with vb.net to print barcode label using Brother Printer PT 98OOPCN. I am using Network Shared, not Peer to Peer. There is my code

Dim objDoc As bpac.Document
objDoc = CreateObject("bpac.Document")
Dim PrinterName As String = "\\hostprinterserver\printer1"

If (objDoc.Open("Label_Barcode\Label_Ex.lbx")) Then
   objDoc.GetObject("dateObject").Text = "10/23/2012"
   objDoc.GetObject("barcodeObject").Text = "100123239734"

   objDoc.SetPrinter(PrinterName, True)
   objDoc.StartPrint("", PrintOptionConstants.bpoDefault)
   objDoc.PrintOut(1, PrintOptionConstants.bpoDefault)
   objDoc.EndPrint()
   objDoc.Close()  
End If

Is it possible to print with Brother SDK to Network Shared Printer? if it is possible how to do that think?

1
You're missing a quote on this line of code -- If (objDoc.Open("Label_Barcode\Label_Ex.lbx"))) Then -- I'd add it but you can't make edits of less than 6 charactersDerek Tomes
I have edited the code, but let's back to the main question. Is it possible to print with Brother SDK to Network Shared Printed? I can list all of the installed printer by objDoc.Printer.GetInstalledPrinters() but still I can't list the printer that I've set as 'shared printer' one. P.s : My Computer has already connected to network-shared printer.Danang Aji
I'm assuming that this is failing and you're trying to figure out why. I would suggest trying to isolate which part of the code is failing by setting the network printer as your default printer (right click on the printer, set as default) and then removing the objDoc.SetPrinter() command. This should let you see if the SetPrinter is failing or if the driver is somehow not working.Derek Tomes

1 Answers

0
votes
Dim PrinterName As String = "printer1 on hostprinterserver'sIP"
For instance:
Dim PrinterName As String = "Brother PT-9600 on 192.168.1.45"

It worked for me!