2017 © Pedro Peláez
 

library gutenberg

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

image

kofel/gutenberg

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

  • Thursday, May 5, 2016
  • by Kofel
  • Repository
  • 0 Watchers
  • 0 Stars
  • 184 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 29 % Grown

The README.md

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., (*1)

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., (*2)

USAGE

Simple proof of usage:, (*3)

<?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., (*4)

TODO

  • Tests :)
  • More printers, ex.: wkhtmltopdf, rendering twig templates, console
  • More printables, ex.: json

The Versions

05/05 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jakub Kaflik