2017 © Pedro Peláez
 

library printer-wrapper

Wrapper for lp printer commands

image

thenodi/printer-wrapper

Wrapper for lp printer commands

  • Monday, April 24, 2017
  • by TheNodi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 71 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

PHP Printer Wrapper

Latest Version on Packagist Build Status Total Downloads, (*1)

Wrapper around unix lp commands used to send file to a printer, manage connected printers and see print queue., (*2)

Installation

You can install the package via composer:, (*3)

composer require thenodi/printer-wrapper

Usage

Basic Usage

Print a file using the default printer., (*4)

<?php
(new \TheNodi\PrinterWrapper\PrinterManager())->printFile('/path/to/file.txt');

List all printers, (*5)

<?php
(new \TheNodi\PrinterWrapper\PrinterManager())->printers();
// => Printer[]

Page Settings

Print a page in landscape mode., (*6)

<?php
(new \TheNodi\PrinterWrapper\PrinterManager())
    ->landscape()
    ->printFile('/path/to/file.txt');

Print a letter., (*7)

<?php
(new \TheNodi\PrinterWrapper\PrinterManager())
    ->media(\TheNodi\PrinterWrapper\Printer::MEDIA_LETTER)
    ->printFile('/path/to/file.txt');

Print a document two-sided., (*8)

<?php
(new \TheNodi\PrinterWrapper\PrinterManager())
    ->twoSided()
    ->printFile('/path/to/file.txt');

If you need to pass a custom option to the lp command use the setOption method., (*9)

<?php
(new \TheNodi\PrinterWrapper\PrinterManager())
    ->setOption('only-name')
    ->setOption('name', 'value')
    ->printFile('/path/to/file.txt');
// => lp -o only-name -o name=value ...

Changelog

Please see CHANGELOG for more information what has changed recently., (*10)

Testing

bash $ composer test, (*11)

Credits

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

24/04 2017

dev-master

9999999-dev

Wrapper for lp printer commands

  Sources   Download

MIT

The Requires

 

The Development Requires

by Leonardo Nodari

24/04 2017

v0.1

0.1.0.0

Wrapper for lp printer commands

  Sources   Download

MIT

The Requires

 

The Development Requires

by Leonardo Nodari