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
Share on other sites

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.