Jump to content

Need Help Sending a Variable to Printer


vozzek

Recommended Posts

Hi all,

 

I've got a php script that builds a nice (html formatted) $message variable and sends it to the customer via email.  This is basically an invoice.

 

What I'd like is to send that exact invoice to my local printer.  Nothing fancy, I just want to shoot that variable to my printer.  I've tried the following:

 

$handle = printer_open();
printer_set_option($handle, printer_MODE, "raw"); 
printer_write($handle, $message);
printer_close($handle);

 

It doesn't print, instead I get: Fatal error: Call to undefined function printer_open()

 

I thought maybe I needed to name the printer, so I replaced the first line with:

 

$handle = printer_open("HP LaserJet 3050 Series PCL 6");

 

Still no dice.

 

I was reading somewhere that I might need to install a .dll file or change my php.ini?  I'm not sure how to do this.  Is there a simple way to do what I'm looking for?  Thanks in advance.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/121576-need-help-sending-a-variable-to-printer/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.