tzhmbtv/php-dmtx

Datamatrix reader/writer based on libdmtx with support for PHP 8.x

Installs: 17

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 7

pkg:composer/tzhmbtv/php-dmtx

dev-master 2025-03-12 17:47 UTC

This package is auto-updated.

Last update: 2026-01-12 19:37:01 UTC


README

Note: This is a fork of the original ptachoire/php-dmtx project with added support for newer PHP versions and PHPUnit 10.x compatibility.

Datamatrix reader/writer based on libdmtx.

⚠️ The installation of dmtx-utils is required to use the lib.

Install

composer require "tzhmbtv/php-dmtx:*"

Usage

use Dmtx\Writer;

$writer = new Writer();

//encode message into file
$writer->encode('this is a message')
    ->saveAs('/tmp/image.png');

//encode message and output image 
echo $writer->encode('this is a message')
    ->dump();
use Dmtx\Reader;

$reader = new Reader();

//decode message from data
$reader->decode($encoded_value);

//decode message from file 
echo $reader->decodeFile('/tmp/image.png');

Test

composer install
./vendor/bin/phpunit

Compatibility

This fork is compatible with:

  • PHP 8.2 or higher
  • PHPUnit 10.x
  • Symfony 3.4, 4.x, 5.x, 6.x, and 7.x packages

Requirements

  • PHP 8.2 or higher
  • dmtx-utils must be installed on your system

Credits

Project structure inspired by Negotiation by willdurand.

Original package created by ptachoire.

Maintained by elnur9924 @tzhmbtv.

License

php-dmtx is released under the MIT License. See the bundled LICENSE file for details.