Printing To A Special Printer in PHP

We have a php web application that needs to print a ticket to a special ticket printer.

We would prefer not to create a PDF and print from that because of the extra clicks and time required. Would prefer to print the ticket directly to the printer.

The ticket is 1.975 inches high and 5.5 inches long. We have the drivers for the printer running under Windows.

what ways can we accomplish this?

Thank you very much,


Did you ever find a work around to this?

I have been using however I am not sure if it works on linux.

It is for a Windows, IIS server, and I am on Linux.

So you should be able to do it by installing the WEBsdk and following the instructions that came with it on how it should be used.

I’m not exactly sure how to control a printer under Windows, but you’re looking into some command line executing.
Google says that this link might help:
You’ll have to create a file of some sort somewhere, however it’s convenient that you only need to provide your user with only one “print” button which invokes the command line.
I don’t know how this will work on a network printer, I’ve been doing this only with Linux installations.

Umm… If the printer is on the client side, how do you expect to be able to do this through the server?

Unless the scenario we are talking about is on a LAN the server would not be able to print from said printer (Well it is possible with some of the network printers, but it would require the server to know the username/password for the printer as well as the ip, firewalls to be opened etc).

If the printer is on the server side (which I assumed) you would handle it on that side, if the printer is on the clients side you need to handle it from there (unless its on a LAN on the same subnet).

Would the (web)users require these tickets? Can you provide more information about the setup and proposed use(s)?

Sounds kind of drastic to solve a problem like this :slight_smile:

I am sure there are other solutions, like maybe writing something on the client side to deal with the printer.

Well, in that case the two most obvious directions you can try is:

  1. Write your own driver for Linux
  2. Change from Linux to a Windows server

Your best bet if you want to stay under Linux is to search if there is a driver available somewhere that works with that printer, and if use it.

Thank you.

I am looking for something a little more elegant than that. The company that makes the printer has a WEBsdk available however it is for Windows Servers only.