Brother label printing b-PAC php library (Windows Only)
Download and install Full b-PAC SDK for developers (SDK, User Guide & sample programs)
The preferred way to install this extension is through composer.
Either run
composer require atans/bpac
or add
"atans/bpac": "*"
to the require section of your composer.json
file.
use atans\bpac\Printer;
use atans\bpac\Document;
$printer = new Printer();
$installedPrinters = $printer->GetInstalledPrinters();
// Same as
// $printer = new Com('bpac.Printer'));
// $installedPrinters = $printer->GetInstalledPrinters();
// Print label using lbx template
$document = new Document();
$document->Open(realpath(__DIR__ . '/tests/assets/device.lbx'))
$document->GetObject('brand')->Text = 'ThinkPad';
$document->StartPrint('', PrintOptionConstants::bpoDefault);
$document->PrintOut(1, PrintOptionConstants::bpoDefault);
$document->EndPrint();
$document->Close();