kofel / gutenberg
With the *kofel/gutenberg* library you can feel that PHP likes to have printing support.
Requires
- php: >=5.5
- kofel/process-util: dev-master
- symfony/process: ~2.6
- twig/twig: ^1.22
Requires (Dev)
- phpunit/phpunit: 4.3.5
This package is not auto-updated.
Last update: 2025-01-04 18:02:57 UTC
README
When Gutenberg in 15 century has invented printing, knowledge has become more common. With the kofel/gutenberg library you can feel that PHP likes to have printing support.
Implementation of Gutenberg relies on two things: Printer and Printable. It's easy visualisation to real world, because there we also have printer and document which we want to print. At this moment library has support only for CUPS printers and printable gLabels file type.
USAGE
Simple proof of usage:
<?php use Gutenberg\Printable\gLabelsPrintable; use Gutenberg\Printer\CUPS\PrinterProfile; use Gutenberg\Printer\CUPSPrinter; $data = [ [ 'sn' => 12345678, 'text' => 'KUBA' ] ]; $printable = new gLabelsPrintable(new \SplFileInfo($argv[1]), $data); $profile = new PrinterProfile('PDF'); $printer = new CUPSPrinter(); $printer->enqueue($printable,$profile);
Important! Please note that CUPSPrinter requires also PrinterProfileInterface instance, because we have to specify where CUPS have to enqueue document.
TODO
- Tests :)
- More printers, ex.: wkhtmltopdf, rendering twig templates, console
- More printables, ex.: json