PHP code example of capsule-corp-co / printer

1. Go to this page and download the library: Download capsule-corp-co/printer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

capsule-corp-co / printer example snippets


'providers' => [
    ...
    CapsuleCorp\Printer\PrintNodeCapsuleServiceProvider::class,
    ...
],
'aliases' => [
	...
	'PrintNodeCapsule' => CapsuleCorp\Printer\PrintNodeCapsuleFacade::class,
	....
]

/*
 * Will return an array of Printer Objects 
 */
PrintNodeCapsule::getPrinters();

/**
 * Print Example
 */

 $printers = PrintNodeCapsule::getPrinters();
 $post_job_arg = array(
     'content' => 'url to a pdf here',
     'printer' => $printer[0],
 );
 $result = PrintNodeCapsule::postPrintJob($post_job_arg);
 

php artisan vendor:publish --provider="CapsuleCorp\Printer\PrintNodeCapsuleServiceProvider"