Skip to content

PHP 7.1 API library for PrintNode - remote printing for web apps

License

Notifications You must be signed in to change notification settings

PhatKoala/PrintNode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrintNode

Changelog

Version 2.0

  • Removed composer.lock file (Credit toooni)
  • Change symfony/http-client version constraint (Credit toooni)
  • Implemented printing from pdf source (Credit toooni)

Version 1..0

  • Initial release

About

PHP 7.1 API library for PrintNode - Remote Printing for Web Apps https://www.printnode.com/

$printNode = new PrintNode(string $auth);
// GET /whoami
$printNode->getWhoAmI(); // returns WhoAmIResponse
// GET /computers
$printNode->getComputers(); // returns ComputersResponse

// GET /computers/COMPUTER SET
$printNode->getComputer(int $computer); // returns ComputerResponse
// DELETE /computers
$printNode->deleteComputers(); // returns DeleteConfirmationResponse

// DELETE /computers/COMPUTER SET
$printNode->deleteComputers(int|array $computers); // returns DeleteConfirmationResponse
// GET /printers
$printNode->getPrinters(); // returns PrintersResponse

// GET /printers/PRINTER SET
$printNode->getPrinter(int $printer); // returns PrinterResponse

// GET /computers/COMPUTER SET/printers
$printNode->getComputerPrinters(int $computer); // returns PrintersResponse

// GET /computers/COMPUTER SET/printers/PRINTER SET
$printNode->getComputerPrinter(int $computer, int $printer); // returns PrinterResponse
// DELETE /printers
$printNode->deletePrinters(); // returns DeleteConfirmationResponse

// DELETE /printers/PRINTER SET
$printNode->deletePrinters(int|array $printers); // returns DeleteConfirmationResponse

// DELETE /computers/COMPUTER SET/printers
$printNode->deleteComputerPrinters(int $computer); // returns DeleteConfirmationResponse

// DELETE /computers/COMPUTER SET/printers/PRINTER SET
$printNode->deleteComputerPrinters(int $computer, int|array $printers); // returns DeleteConfirmationResponse
// GET /printjobs
$printJobFile = $printNode->createPrintJobFile(int $printer, string $title, string $source); // returns PrintJobFile
$printJobFile->send('path/to/file.pdf'); // returns Print Job ID

$printJobFile = $printNode->createPrintJobPdfSource(int $printer, string $title, string $source); // returns PrintJobFile
$printJobFile->send($pdfSource); // returns Print Job ID

$printJobUrl = $printNode->createPrintJobUrl(int $printer, string $title, string $source); // returns PrintJobUrl
$printJobUrl->send('https://www.domain.com/path/to/file.pdf'); // returns Print Job ID
// GET /printjobs

// GET /printjobs/PRINT JOB SET

// GET /printers/PRINTER SET/printjobs

// GET /printers/PRINTER SET/printjobs/PRINT JOB SET
// DELETE /printjobs

// DELETE /printjobs/PRINT JOB SET

// DELETE /printers/PRINTER SET/printjobs

// DELETE /printers/PRINTER SET/printjobs/PRINT JOB SET
// GET /printjobs/states

// GET /printjobs/PRINT JOB SET/states
// GET /computer/COMPUTER ID/scales

// GET /computer/COMPUTER ID/scales/DEVICE NAME

// GET /computer/COMPUTER ID/scale/DEVICE NAME/DEVICE NUMBER
// PUT /scale
// POST /account
$newAccount = $printNode->createAccount('[email protected]', 'my-passw0rd'); // returns ChildAccountRequest
$newAccount
  ->setCreatorRef('my-unique-reference')
  ->addTag('likes', 'dogs')
  ->addTags([
      'eats' => 'pie',
      'plays' => 'football',
  ])
  ->removeTag('eats')
  ->addApiKey('development')
  ->addApiKeys([
      'staging',
      'production',
  ])
  ->removeApiKey('development');
  
$newAccount->send(); // returns ChildAccountResponse
// PATCH /account
// PUT /account/state
$childAccount = $printNode->getChildAccount($id); // returns PrintNode
$childAccount->suspend();
$childAccount->activate();
// DELETE /account
$childAccount = $printNode->getChildAccount($id); // returns PrintNode
$childAccount->delete();
$childAccount = $printNode->getChildAccount($id); // returns PrintNode
// or
$childAccount = $printNode->getChildAccount($email, PrintNode::$CHILD_AUTH_BY_EMAIL); // returns PrintNode
// or
$childAccount = $printNode->getChildAccount($creatorRef, PrintNode::$CHILD_AUTH_BY_CREATOR_REF); // returns PrintNode
// POST /account/tag/NAME

// GET /account/tag/NAME

// DELETE /account/tag/NAME
// POST /account/apikey/DESCRIPTION

// GET /account/apikey/DESCRIPTION

// DELETE /account/apikey/DESCRIPTION
$clientKey = $childAccount->getClientKey($uuid, $edition, $version); // returns string 
// GET /ping
PrintNode::ping(); // returns true/false
// GET /noop
$printNode->noop(); // returns true/false

About

PHP 7.1 API library for PrintNode - remote printing for web apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages