Fork of obray/ipp with configurable IPP version support.
Default version: 2.0 (original library uses mixed 1.1/2.1)
composer require aleshin/ipp-20- Added configurable IPP version (default:
2.0) - Added
setVersion()/getVersion()methods toPrinterandJobclasses - Version can be set via constructor or setter method
- All operations now use the configured version consistently
<?php
use obray\ipp\Printer;
use obray\ipp\Job;
// Default version is 2.0
$printer = new Printer('ipp://your-printer/ipp/print');
// Or specify version in constructor
$printer = new Printer(
'ipp://your-printer/ipp/print',
'username', // optional
'password', // optional
[], // curlOptions
'2.0' // IPP version
);
// Or change version after creation
$printer->setVersion('2.0');
$printer->setVersion('1.1'); // if needed
// Get current version
echo $printer->getVersion(); // "2.0"
// Print a document
$response = $printer->printJob(
file_get_contents('document.pdf'),
1, // request ID
['document-format' => 'application/pdf']
);
// Get printer attributes
$attributes = $printer->getPrinterAttributes();
// Job operations also support version
$job = new Job($printerUri, $jobId, $user, $password, [], '2.0');
$job->setVersion('2.0');1.1- IPP/1.1 (RFC 2911)2.0- IPP/2.0 (default)2.1- IPP/2.12.2- IPP/2.2
printJob()- Print a documentvalidateJob()- Validate job before printinggetPrinterAttributes()- Get printer capabilitiesgetJobs()- List print jobspausePrinter()- Pause printerresumePrinter()- Resume printerpurgeJobs()- Remove all jobs
cancelJob()- Cancel a jobgetJobAttributes()- Get job detailsholdJob()- Hold job in queuereleaseJob()- Release held jobrestartJob()- Restart completed job
MIT License - see LICENSE
Based on nateobray/IPP