Jump to content

Recommended Posts

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);

?>

Link to comment
https://forums.phpfreaks.com/topic/42941-printer_open-gives-error/
Share on other sites

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.

 

"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.

  • 4 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.