Skip to content

nechutny/php_print

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php_print

Print a document from PHP in Linux. Printer PECL extension works on Windows only, this is the solution for Unix.

#What it is?

This is a PHP native extension. That means that you need to load it via "extension=php_print.so" in php.ini, or via function call "dl('php_print.so')" in runtime.

It can send documents (as txt files, pdf and others) to printer. Formats are not fully tested yet, but basic plain text files and PDFs work.

This extension is just a thin wrapper for CUPS library.

How to

  1. Install PHP-CPP

     http://www.php-cpp.com/documentation/install
    
  2. Install cups libraries

Fedora:

	sudo yum install cups-devel

Ubuntu:

	sudo apt-get install libcups2-dev
  1. make

  2. sudo make install

  3. use from php

     <?php
     print_file('document.pdf');
     ?>
    

Tested

Works on Fedora 21 with PHP 5.6 and any printer supported by CUPS.

About

Print from PHP in Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published