laravel-printing

Cups

PrintJob Service

The PrintJobService can be used to create new print jobs and fetch existing jobs from the CUPS server.

All methods are callable from the CupsClient class.

$printJobs = $client->printJobs->all();

See the API Overview for more information on interacting with the PrintNode API.


Rawilk\Printing\Api\Cups\Resources\PrintJob

Create a new print job for CUPS to send to a physical printer.

param type default
$pendingJob Rawilk\Printing\Api\Cups\PendingPrintJob|Rawilk\Printing\Api\Cups\PendingRequest
$opts null|array|RequestOptions null

We recommend using a PendingPrintJob object for the $pendingJob argument.

Example:

use Rawilk\Printing\Api\Cups\PendingPrintJob;
use Rawilk\Printing\Api\Cups\Enums\ContentType;

$pendingJob = PendingPrintJob::make()
    ->setContent('hello world')
    ->setContentType(ContentType::Plain)
    ->setPrinter($printerUri)
    ->setTitle('My job title')
    ->setSource(config('app.name'));

$printJob = $client->printJobs->create($pendingJob);

Rawilk\Printing\Api\Cups\Resources\PrintJob

Retrieve a job from the CUPS server by its uri.

param type default description
$uri string The job's uri
$params array|null null
$opts null|array|RequestOptions null


string

The uri to the job. Alias to $jobUri.


string

The uri to the job.


?string

The name of the job.


string

The uri to the printer the job was sent to.


int

An integer representation of the job's state.


?string

The date/time the job was created and sent to the printer.



Rawilk\Printing\Api\Cups\Enums\JobState

Returns an enum representation of the job's current state.


?string

Returns the name of the printer the job was sent to.


Previous
Printer Service