PHPackages                             ramytalal/label-printer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ramytalal/label-printer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ramytalal/label-printer
=======================

An implementation of the Brother label printer API.

1.2.0(2y ago)6543.4k↓40.6%22[14 issues](https://github.com/RamyTalal/Label-Printer/issues)[1 PRs](https://github.com/RamyTalal/Label-Printer/pulls)MITPHPPHP &gt;=5.5.9CI failing

Since Apr 8Pushed 2y ago10 watchersCompare

[ Source](https://github.com/RamyTalal/Label-Printer)[ Packagist](https://packagist.org/packages/ramytalal/label-printer)[ Docs](https://github.com/RamyTalal/Label-Printer)[ RSS](/packages/ramytalal-label-printer/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (3)Versions (8)Used By (0)

Label Printer
=============

[](#label-printer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8d02281cb67eaea79925f6cafd61fbe8008619a82a59dc7f24e6b86f03aecb56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f52616d7954616c616c2f4c6162656c2d5072696e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/RamyTalal/Label-Printer)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/4e32a46c53c8be566bbee2d26bc7105289f6314224696451afbed0cd9b75e3f2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f52616d7954616c616c2f4c6162656c2d5072696e7465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/RamyTalal/Label-Printer)[![Coverage Status](https://camo.githubusercontent.com/04ad269e3bf381161b8e889cd7f52150e55661cbfe9369699f0dde1486b30177/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f52616d7954616c616c2f4c6162656c2d5072696e7465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/RamyTalal/Label-Printer/code-structure)[![Quality Score](https://camo.githubusercontent.com/a64190a416baef9ca848feed257ad7e033fa0b17b068782f6bfa0556429a4bd5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f52616d7954616c616c2f4c6162656c2d5072696e7465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/RamyTalal/Label-Printer)[![Total Downloads](https://camo.githubusercontent.com/b6a19feca45c2eb6bd545bda04c88f829f52b26dcd5d71293194d0aa9e68ad92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f52616d7954616c616c2f4c6162656c2d5072696e7465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/RamyTalal/Label-Printer)

**This library is a WIP.**

Easily print labels with a Brother label printer.

This library is tested with the following Brother printers,

- QL-580N - tested by [xelan](https://github.com/xelan)
- QL-720NW - tested by [RamyTalal](https://github.com/RamyTalal)
- QL-810W - tested by [ntaylor-86](https://github.com/ntaylor-86)
- QL-820NWB - Tested by [ArienClaij](https://github.com/arienclaij/) and Luc99
- QL-1110NWB - Tested by [JETomi](https://github.com/JETomi)

so it may not work with other printers.

Install
-------

[](#install)

### Composer

[](#composer)

```
$ composer require RamyTalal/Label-Printer
```

Usage
-----

[](#usage)

### ESC/P

[](#escp)

```
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

[](#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

[](#template)

```
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\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'));

$printer->printLabel();

fclose($stream);
```

### Barcode generation

[](#barcode-generation)

```
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
-------

[](#testing)

```
$ composer test
```

TODO
----

[](#todo)

- Documentation

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Credits
-------

[](#credits)

- [Ramy Talal](https://github.com/RamyTalal)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~545 days

Recently: every ~332 days

Total

6

Last Release

1016d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4215cd8d15006c8b09fecbb1d7df2e46af921f73cf8952583e6ef7718efd3864?d=identicon)[RamyTalal](/maintainers/RamyTalal)

---

Top Contributors

[![RamyTalal](https://avatars.githubusercontent.com/u/188874?v=4)](https://github.com/RamyTalal "RamyTalal (12 commits)")[![ntaylor-86](https://avatars.githubusercontent.com/u/28693782?v=4)](https://github.com/ntaylor-86 "ntaylor-86 (7 commits)")[![xelan](https://avatars.githubusercontent.com/u/5080535?v=4)](https://github.com/xelan "xelan (6 commits)")[![CSchlipp](https://avatars.githubusercontent.com/u/4139563?v=4)](https://github.com/CSchlipp "CSchlipp (3 commits)")[![arienclaij](https://avatars.githubusercontent.com/u/25978746?v=4)](https://github.com/arienclaij "arienclaij (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

---

Tags

brother-label-printercomposerlabel-printerphpprinterlabelbrotherlabel printer

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ramytalal-label-printer/health.svg)

```
[![Health](https://phpackages.com/badges/ramytalal-label-printer/health.svg)](https://phpackages.com/packages/ramytalal-label-printer)
```

###  Alternatives

[mike42/escpos-php

PHP receipt printer library for use with ESC/POS-compatible thermal and impact printers

2.8k2.1M25](/packages/mike42-escpos-php)[kartik-v/yii2-label-inplace

A form enhancement widget for Yii2 allowing in-field label support.

1285.3k](/packages/kartik-v-yii2-label-inplace)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
