PHP code example of atans / bpac
1. Go to this page and download the library: Download atans/bpac library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
atans / bpac example snippets
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();