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.

EXCELLENT!
Thank you very much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.