atans/bpac

Brother label printing b-PAC php library (Windows Only)

Maintainers

Details

github.com/atans/bpac

Source

Issues

Installs: 192

Dependents: 0

Suggesters: 0

Security: 0

Stars: 13

Watchers: 3

Forks: 3

Open Issues: 1

Type:api

1.0.2 2017-01-10 03:01 UTC

This package is auto-updated.

Last update: 2024-04-13 22:04:53 UTC


README

Brother label printing b-PAC php library (Windows Only)

Installation

Step 1.Install Labelling SDK (b-PAC)

Download and install Full b-PAC SDK for developers (SDK, User Guide & sample programs)

Step 2.Composer install atans/bpac

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.

Usage

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