Skip to content

jkaflik/Gutenberg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gutenberg (WIP)

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

About

With the *kofel/gutenberg* library you can feel that PHP likes to have printing support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages