Skip to content

neysi/directprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Direct Print

This library allows printing files directly from PHP. Avoid print dialog preview in the web browser. Linux and MacOS Compatible. CUPS Required.

Installation

Include the library

Composer

If you are using composer, then add neysi/directprint as a dependency:

composer require neysi/directprint

Manual

If you have no composer, download the code and include autoload.php

git clone https://github.com/neysi/directprint.git
<?php
require __DIR__ . '/vendor/neysi/directprint/autoload.php');

Methods

printFile($fileName,$printerName)

Print on the default printer:

$id =  DirectPrint::printFile('invoice.pdf') ;

Print on the Canon iP2800 Printer:

$id = DirectPrint::printFile('invoice.pdf','Canon_iP2800_series') ;

getDefaultPrinter()

$printerName =  DirectPrint::getDefaultPrinter() ;

getPrinters()

$printers =  DirectPrint::getPrinters() ;

activeJobs()

Displays print queue

cancelAllJobs()

Cancel all of the print queue

cancelJob($jobID)

Cancel a specific print job

About

Easy and direct file print from PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages