Skip to content

Biterika/ipp-20

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPP 2.0 - PHP IPP Client

Fork of obray/ipp with configurable IPP version support.

Default version: 2.0 (original library uses mixed 1.1/2.1)

Installation

composer require aleshin/ipp-20

Changes from original

  • Added configurable IPP version (default: 2.0)
  • Added setVersion() / getVersion() methods to Printer and Job classes
  • Version can be set via constructor or setter method
  • All operations now use the configured version consistently

Usage

<?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');

Supported IPP Versions

  • 1.1 - IPP/1.1 (RFC 2911)
  • 2.0 - IPP/2.0 (default)
  • 2.1 - IPP/2.1
  • 2.2 - IPP/2.2

Printer Methods

  • printJob() - Print a document
  • validateJob() - Validate job before printing
  • getPrinterAttributes() - Get printer capabilities
  • getJobs() - List print jobs
  • pausePrinter() - Pause printer
  • resumePrinter() - Resume printer
  • purgeJobs() - Remove all jobs

Job Methods

  • cancelJob() - Cancel a job
  • getJobAttributes() - Get job details
  • holdJob() - Hold job in queue
  • releaseJob() - Release held job
  • restartJob() - Restart completed job

License

MIT License - see LICENSE

Credits

Based on nateobray/IPP

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages