Updated readme
This commit is contained in:
parent
0c684980da
commit
11d642b8a4
31
README.md
Normal file
31
README.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
noccylabs/lpr
|
||||||
|
=============
|
||||||
|
|
||||||
|
This is a library to make it easier to work with the `lpr` tool to print
|
||||||
|
documents and images from code.
|
||||||
|
|
||||||
|
## Installing
|
||||||
|
|
||||||
|
Install using composer:
|
||||||
|
|
||||||
|
$ composer require noccylabs/lpr
|
||||||
|
|
||||||
|
## Using
|
||||||
|
|
||||||
|
The `PrintJob` class is used to create new jobs. Create an instance, passing
|
||||||
|
the name of the document or image to print to the constructor, and then
|
||||||
|
set your options. Finally, `submit()` the job to the printer.
|
||||||
|
|
||||||
|
use NoccyLabs\Lpr\PrintJob;
|
||||||
|
|
||||||
|
$job = new PrintJob("image.png");
|
||||||
|
|
||||||
|
// Configure
|
||||||
|
$job->setPrinter("MyPrinter");
|
||||||
|
$job->setMedia("A4");
|
||||||
|
|
||||||
|
// Additional options can be set like this
|
||||||
|
$job->setOption("fit-to-page", true);
|
||||||
|
|
||||||
|
// Invoke lpr to print the image
|
||||||
|
$job->submit();
|
Loading…
Reference in New Issue
Block a user