0

Hi,

I got "Fatal error: Call to undefined function printer_open() in C:\wamp\www\TEST\printer\index.php on line 3" when I run code below.

<?php 
$printer = "\\\\lukaka\\hp LaserJet 1320"; 
if($ph = printer_open($printer)) 
{ 
   // Get file contents 
   $fh = fopen("testfile.txt", "rb"); 
   $content = fread($fh, filesize("testfile.txt")); 
   fclose($fh); 
        
   // Set print mode to RAW and send PDF to printer 
   printer_set_option($ph, PRINTER_MODE, "RAW"); 
   printer_write($ph, $content); 
   printer_close($ph); 
} 
else "Couldn't connect..."; 
?>

I have added "extension=php_printer.dll" to php.ini and downloaded php_printer.dll file into "C:\wamp\bin\php\php5.3.0\ext" folder.

WhenI restart WAMP, it says "PHP startup: Unable to load dydnamic library 'c:.....php_printer.dll'...."

I use PHP 5.3.0

Thanks for help.

Edited by veledrom: .

3
Contributors
3
Replies
10
Views
6 Years
Discussion Span
Last Post by crazy_chanaka
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.