rameshfaj Posted March 16, 2007 Share Posted March 16, 2007 I wanted to print the data displayed within a frame/form using php's printer related functions.But i got the error message: Fatal error: Call to undefined function: printer_open() in c:\program files\easyphp1-7\www\binod\print.php on line 8. Actually what had happened and what might be the solution? The code is shown below: <?php $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $font = printer_create_font("Arial", 72, 48, 400, false, false, false, 0); printer_select_font($handle, $font); printer_draw_text($handle, "test", 10, 10); printer_delete_font($font); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ?> Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/ Share on other sites More sharing options...
per1os Posted March 16, 2007 Share Posted March 16, 2007 Are you sure you have the printer compiled with your version of php? http://us3.php.net/manual/en/function.printer-open.php it states it might only be in CVS, meaning you need that compiled version of php to have that functionality. http://us3.php.net/manual/en/ref.printer.php and this notes you need PECL installed. Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-208577 Share on other sites More sharing options...
btherl Posted March 16, 2007 Share Posted March 16, 2007 The main page gives more information for installation. Basically you must install a dll before you can use those functions. http://sg.php.net/manual/en/ref.printer.php Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-208580 Share on other sites More sharing options...
rameshfaj Posted March 16, 2007 Author Share Posted March 16, 2007 Which dll file should I install? Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-208600 Share on other sites More sharing options...
btherl Posted March 16, 2007 Share Posted March 16, 2007 "Windows users must enable php_printer.dll inside of php.ini in order to use these functions. Unbundled PECL extensions may be downloaded from: » http://pecl4win.php.net/" You will find the file under "PECL extensions" on the website mentioned in the above quote. Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-208602 Share on other sites More sharing options...
rameshfaj Posted March 16, 2007 Author Share Posted March 16, 2007 I have done the following changes to my php.ini file: printer.default_printer =PHP_INI_ALL .. extension=php_printer.dll But it still doesnot work.Why? Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-208616 Share on other sites More sharing options...
btherl Posted March 16, 2007 Share Posted March 16, 2007 Did you copy the dll into the "extension_dir" folder (should be listed in php.ini), and restart the webserver? There's brief installation instructions here: http://www.php.net/manual/en/install.pecl.windows.php Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-208619 Share on other sites More sharing options...
rameshfaj Posted March 20, 2007 Author Share Posted March 20, 2007 what is the dll file that I should download from the PECL sites? Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-210891 Share on other sites More sharing options...
dave_england03 Posted August 17, 2007 Share Posted August 17, 2007 download php_printer.dll prior to the PHP version you are using. Quote Link to comment https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/#findComment-326393 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.