laravel-printing
Cups
PrintJob Service
On this page
Introduction
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.
Reference
Methods
create
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);
retrieve
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 |
PrintJob Resource
Properties
uri
string
The uri to the job. Alias to $jobUri
.
jobUri
string
The uri to the job.
jobName
?string
The name of the job.
jobPrinterUri
string
The uri to the printer the job was sent to.
jobState
int
An integer representation of the job's state.
dateTimeAtCreation
?string
The date/time the job was created and sent to the printer.
Methods
state
Rawilk\Printing\Api\Cups\Enums\JobState
Returns an enum representation of the job's current state.
printerName
?string
Returns the name of the printer the job was sent to.