Sunday, 21 July 2013

PHP php_printer.dll Installation and Configuration


1. Download xampp Server from http://www.oldapps.com/xampp.php?old_xampp=44

2. Install it

3. Goto Xammp Home directory (ex C:\Xampp)

4. Then open php flder

5. Then open php.ini file.

6. Find ;extension=php_printer.dll

7. Then Remove ";"

8. Done

Without Xampp users

1. Download lates php_print.dll from http://us.php.net/get/pecl-5.2.6-Win32.zip/from/a/mirror

2. After download and extract, you get php_print.dll.

3. Copy this dll and goto your php\ext directory and paste it.

4. Then open php.ini file.

5. Find (extension_dir="C:\Program Files\PHP\ext") on that file.

6. The add this line (extension=php_printer.dll) line.

7. DOne


Example for php print to printer example.

<?php
$printer = "\\\\servername\\printername";
$handle = printer_open($printer);
        printer_set_option($handle, PRINTER_MODE, "raw");
printer_set_option($handle, PRINTER_PAPER_FORMAT, PRINTER_FORMAT_A5);
$output = "Print Contents";
printer_write($handle,$output);
    printer_close($handle);
?>

Kindly Bookmark and Share it:

1 comment:

Related Posts Plugin for WordPress, Blogger...