I was reading on an earlier post that it's possible to have PHP send a command to print a document on your printer -- for example when an order is processed, to automatically print the invoice on my office laserjet.

I was hoping someone was familiar with using this function, perhaps in association with CUPS. My big issue is that my website is hosted on a remote server so to call my printer I would have to figure out a way to assign it a distinct IP address (is this through CUPS or a print server?)

Thanks

    Here is a solution:

    1. Ask your systems admin to configure the remote printer so that it can be printed to from the web application server (They may need VPNs or whatever, talking to your network admin etc, but I'm sure they can do it if there is a business case and budget, even if it requires additional hardware/software purchases)
    2. Test that they've done it right, by printing something to it from the command line shell and making sure it comes out
    3. Modify your web application to print to this print queue.

    Mark

      8 days later

      Thanks for the replies.

      Do I need to setup my printer on a print server to do this? Or is it fine that it's connected through a Windows XP machine like a regular printer?

        cmdr_bond wrote:

        Do I need to setup my printer on a print server to do this? Or is it fine that it's connected through a Windows XP machine like a regular printer?

        However your sysadmin advises you that it needs to be set up.

        Your systems administrator should be able to configure the printer for working with your development / staging / production web servers if necessary, if there is budget for any additional software / hardware.

        Whatever mechanism that is by is entirely up to them.

        Mark

          With the printer setup, how do I send the commands to print?
          I can use the following command with the command prompt, but I'm not sure how to get PHP to use it:

          lpr -P 192.168.1.130 testfile.ps
          

            not familiar but shell_exec('cmd') can execute commands at shell

            look into it a php manual...

              Write a Reply...