LPD Server and Client for PHP language.
Via Composer
$ composer require kduma/lpd
(new KDuma\LPD\Server\Server())
->setAddress($address)
->setPort($port)
->setMaxConnections($max_connections)
->setHandler(function ($incoming_data, $ctrl) {
echo $incoming_data; // Do something with it!
})
->run();
For printing clear text use TextJob
class:
$job = new KDuma\LPD\Client\Jobs\TextJob("This is content!");
$job->appdendContent("\n");
$job->appdendContent("And this is second line.");
For printing files, text or binary, use FileJob
class:
$job = new KDuma\LPD\Client\Jobs\FileJob("my_raw_file.txt");
$configuration = new KDuma\LPD\Client\Configuration($address, $queue_name, $port, $timeout);
$print_service = new KDuma\LPD\Client\PrintService($configuration);
$print_service->sendJob($job);
This package is based on classes created by Ivan Bozhanov (server, 2013) and Mick Sear (client, 2005).