2017 © Pedro Peláez
 

library label-printer

An implementation of the Brother label printer API.

image

ramytalal/label-printer

An implementation of the Brother label printer API.

  • Wednesday, March 7, 2018
  • by RamyTalal
  • Repository
  • 2 Watchers
  • 10 Stars
  • 217 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

Label Printer

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

This library is a WIP., (*2)

Easily print labels with a Brother label printer., (*3)

This library is tested with the following Brother printers,, (*4)

so it may not work with other printers., (*5)

Install

Composer

``` bash $ composer require RamyTalal/Label-Printer, (*6)


## Usage ### ESC/P ``` php use Talal\LabelPrinter\Printer; use Talal\LabelPrinter\Mode\Escp; use Talal\LabelPrinter\Command; $stream = stream_socket_client('tcp://192.168.1.8:9100', $errorNumber, $errorString); $printer = new Printer(new Escp($stream)); $font = new Command\Font('brussels', Command\Font::TYPE_OUTLINE); $printer->addCommand(new Command\CharStyle(Command\CharStyle::NORMAL)); $printer->addCommand($font); $printer->addCommand(new Command\CharSize(46, $font)); $printer->addCommand(new Command\Align(Command\Align::CENTER)); $printer->addCommand(new Command\Text('Hallo')); $printer->addCommand(new Command\Cut(Command\Cut::FULL)); $printer->printLabel(); fclose($stream);

AutoCut Feature

// Disable the AutoCut on the printer
$printer->addCommand(new Command\AutoCut(Command\AutoCut::DISABLED));

// Enable the AutoCut on the printer
$printer->addCommand(new Command\AutoCut(Command\AutoCut::ENABLED));

Template

``` php use Talal\LabelPrinter\Printer; use Talal\LabelPrinter\Mode\Template; use Talal\LabelPrinter\Command;, (*7)

$stream = stream_socket_client('tcp://192.168.1.8:9100', $errorNumber, $errorString);, (*8)

$printer = new Printer(new Template(2, $stream)); $printer->addCommand(new Command\ObjectCommand('title', 'R. Talal')); $printer->addCommand(new Command\ObjectCommand('address', 'H.H. Schefferlaan 9')); $printer->addCommand(new Command\ObjectCommand('postalcode', '7771 CW')); $printer->addCommand(new Command\ObjectCommand('city', 'Hardenberg'));, (*9)

$printer->printLabel();, (*10)

fclose($stream);, (*11)


### Barcode generation ``` php use Talal\LabelPrinter\Printer; use Talal\LabelPrinter\Mode\Template; use Talal\LabelPrinter\Command; $stream = stream_socket_client('tcp://192.168.1.8:9100', $errorNumber, $errorString); $printer = new Printer(new Template(2, $stream)); $printer->addCommand(new Command\Barcode('1234', 80, Command\Barcode::WIDTH_SMALL, 'code39', false, 2.5)); // or QR code // $printer->addCommand(new Command\QrCode('https://example.com')); $printer->printLabel(); fclose($stream);

Testing

bash $ composer test, (*12)

TODO

  • [ ] Documentation

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*13)

Credits

License

The MIT License (MIT). Please see License File for more information., (*14)

The Versions

07/03 2018

dev-additional-commands

dev-additional-commands https://github.com/RamyTalal/Label-Printer

An implementation of the Brother label printer API.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

printer brother label label printer

02/01 2017

dev-master

9999999-dev https://github.com/RamyTalal/Label-Printer

An implementation of the Brother label printer API.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

printer brother label label printer

08/04 2016

v1.0.0

1.0.0.0 https://github.com/RamyTalal/Label-Printer

An implementation of the Brother label printer API.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

printer brother label label printer