laravel-printing

PrintNode

PrintJob Service

The PrintJobService can be used to create new print jobs and fetch existing jobs on your PrintNode account.

All methods are callable from the PrintNodeClient class.

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

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


Collection<int, Rawilk\Printing\Api\PrintNode\Resources\PrintJob>

Retrieve all print jobs associated with a PrintNode account.

param type default
$params array|null null
$opts null|array|RequestOptions null

Rawilk\Printing\Api\PrintNode\Resources\PrintJob

Create a new print job for PrintNode to send to a physical printer. Note: although the $params argument accepts an array, it is recommended to send through a PendingPrintJob object instead.

param type default
$params array|PendingPrintJob null
$opts null|array|RequestOptions null

Example:

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

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

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

Rawilk\Printing\Api\PrintNode\Resources\PrintJob

Retrieve a print job by ID.

param type default description
$id int the print job's ID
$params array|null null not applicable to this request
$opts null|array|RequestOptions null

Collection<int, Rawilk\Printing\Api\PrintNode\Resources\PrintJob>

Retrieve a specific set of print jobs.

param type default description
$ids array the print job IDs
$params array|null null
$opts null|array|RequestOptions null

Collection<int, Rawilk\Printing\Api\PrintNode\Resources\PrintJobState>

Retrieve all print job states for an account.

Note: If a limit is passed in with $params, it applies to the amount of print jobs to retrieve states for. For example, if there are 3 print jobs with 5 states each, and a limit of 2 is specified, a total of 10 print job states will be received.

param type default
$params array|null null
$opts null|array|RequestOptions null

Collection<int, Rawilk\Printing\Api\PrintNode\Resources\PrintJobState>

Retrieve the print job states for a given print job.

param type default description
$parentId int|array the print job's ID
$params array|null null
$opts null|array|RequestOptions null

array

Cancel (delete) a set of pending print jobs. Method will return an array of affected IDs. Omit or use an empty array of $ids to delete all jobs.

param type default
$ids array
$params array|null null
$opts null|array|RequestOptions null

array

Cancel (delete) a given pending print job. Method will return an array of affected IDs.

param type default
$id int
$params array|null null
$opts null|array|RequestOptions null

Rawilk\Printing\Api\PrintNode\Resources\PrintJob

A PrintJob represents a print job in the PrintNode API.


int

The print job's ID.


string

Time and date the print job was created.


Rawilk\Printing\Api\PrintNode\Resources\Printer

The printer the job was sent to.


string

The title of the print job.


string

The content type of the print job.


string

A string that describes the origin of the print job.


?string

The time at which the print job expires.


string

The current state of the print job.



?CarbonInterface

A date object representing the date and time the print job was created.


?CarbonInterface

A date object representing the date and time the print job will expire.


Rawilk\Printing\Api\PrintNode\Resources\PrintJob

Delete (cancel) the print job.

param type default
$params array|null null
$opts null|array|RequestOptions null

Collection<int, Rawilk\Printing\Api\PrintNode\Resources\PrintJobState>

Get all the states that PrintNode has reported for the print job.

param type default
$params array|null null
$opts null|array|RequestOptions null


Rawilk\Printing\Api\PrintNode\Resources\PrintJob

Create and send a new print job through the PrintNode API.

param type default
$params array|PendingPrintJob
$opts null|array|RequestOptions null

Example:

use Rawilk\Printing\Api\PrintNode\PendingPrintJob;
use Rawilk\Printing\Api\PrintNode\Enums\ContentType;
use Rawilk\Printing\Api\PrintNode\Resources\PrintJob;

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

$printJob = PrintJob::create($pendingJob);

Collection<int, Rawilk\Printing\Api\PrintNode\Resources\PrintJob>

Retrieve all print jobs.

$printJobs = PrintJob::all();
param type default
$params null|array null
$opts null|array|RequestOptions null

Rawilk\Printing\Api\PrintNode\Resources\PrintJob

Retrieve a print job with a given id.

$printJob = PrintJob::retrieve(100);
param type default
$id int
$params null|array null
$opts null|array|RequestOptions null

Rawilk\Printing\Api\PrintNode\Resources\PrintJobState

A PrintJobState represents a state that a PrintJob was in at a given time in the PrintNode API.


int

The ID of the print job the state is for.


string

The state code for the print job.


string

Additional information about the state.


?string

If the state was generated by a PrintNode Client, this is the Client's version; otherwise null.


string

If the state was generated by a PrintNodeClient, this is the timestamp at which the state was reported to the PrintNode server. Otherwise, it is the timestamp at which the PrintNode Server generated the state.



?CarbonInterface

A date object representing the date and time the state was created for the print job.



Collection<int, Rawilk\Printing\Api\PrintNode\Resources\PrintJobState>

Retrieve all print job states.

$states = PrintJobState::all();
param type default
$params null|array null
$opts null|array|RequestOptions null

Previous
Printer Service