finds.dev← search

// the find

mike42/escpos-php

★ 2,796 · PHP · NOASSERTION · updated Aug 2026

PHP library for printing to ESC/POS-compatible thermal and impact printers

A PHP driver for talking to ESC/POS thermal and impact receipt printers — handles the raw protocol for text formatting, cutting, barcodes, QR/PDF417 codes and image printing. Aimed at anyone building a web-based POS system in PHP who needs to print receipts without shelling out to a proprietary SDK.

The PrintConnector abstraction cleanly separates 'generate the byte stream' from 'get bytes to the device', so the same receipt code works over network, USB, serial, CUPS or a Windows share — you just swap the connector. CapabilityProfile pulls vendor command differences (Epson vs Star vs generic) from the separate escpos-printer-db project instead of hardcoding them, so profile data can be updated without a library release. Image handling has a real fallback chain (imagick → gd → bundled gfx-php), so it degrades gracefully on minimal PHP installs instead of hard-depending on an extension. CI actually runs the test suite across PHP 8.2 through 8.5, and the compatibility table is clearly the product of years of user-submitted reports rather than vendor claims.

It's fundamentally synchronous blocking I/O against a live connection — there's no retry/reconnect handling for a USB printer that drops out mid-job or a flaky network socket, so production use needs your own wrapper around that. Barcode support is stuck on older standards (CODE39, UPC, JAN, Codabar) with CODE128 and other quirks relegated to one-off scripts in example/specific/ rather than first-class API support. The 'many printers kinda work' compatibility list is exactly the kind of thing that bites you later — two models from the same vendor can behave differently and you won't know until you're printing garbage on hardware you already bought. Windows support is actually 'write to a temp file, copy() it into a mapped LPT/SMB share,' which is a print-queue workaround, not a direct driver, and adds its own latency and failure modes.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →