Print Photo ID Card to a plastic card printer from web site

5.4k views Asked by At

Does anyone have experience with printing directly to a Photo ID Card printer in a web browser?

I have a web application that manages user data, photo, and so forth. I'd like to add a Print ID Card feature to it. The web application is a single page javascript application that talks to a RESTful web service via JSON. I'd like to display what the printed card will look like on both the front and back for approval before the user clicks the print button.

I'm considering ways to do this:

  • Generate front and back JPG or PNG images to print on the server, send them to the client for display and approval, and then somehow send the images to the printer.
  • Use javascript with SVG or Canvas to display the card to print in the UI for approval, then somehow send the SVG/canvas data to the printer.
  • Generate a PDF and print the PDF to the printer.
  • Use Flash to display and print
  • Use a Java applet to display and print
  • Something else?

I'm looking for any sort of guidance that anyone can provide on any aspect of doing this. If you've been down this road before, I'd appreciate hearing from you. In particular:

  • What resources did you find to learn about doing this?
  • Are there any particular printer brands that work better than others?
  • Are any of the ways I describe above better, and why?
  • Could I also print barcodes, magnetic stripe data, sim card data, and so forth?

I know this question might be a shot in the dark, but any information would help. Thanks!

3

There are 3 answers

1
Damien On BEST ANSWER

My company did this using option "2", e.g. an agent (actually an MFC app) running on a machine with a card printer attached.

The agent periodically checks an internet URL looking for new print jobs; print jobs are defined using scripts generated on the web server, the script includes details like mag stripe data to be encoded, user names/pictures and where to print them on the card stock, and so on. The agent posts back to the server after a successful print job. Posting back to the server is important because card printers tend to fail regularly.

The big benefit to this approach is that multiple users can share a single printer so you don't need to buy a printer for each workstation where card registration occurs. Card printers can be fussy and require a lot maintenance, so it's easier to support a single printer.

Another benefit is that you don't have to write plug-ins for all the browser platforms you want to support. Finally, it lets users with Linux/MacOS print cards using the system (as long as they are willing to setup a windows machine to drive the printer.)

2
RichO On

From a 40,000 foot view. I can think of two Microsoft Centric ways... both involving processes outside of the browser.

1) Use Internet Explorer, and write an IE Plugin application that plugs into the browser through an object declaration, and is passed Javascript field values for data, images, etc. All communication to the printer/print-driver is handled by the remoting .dll. I suppose you can also do something similar with a Firefox plugin. I use this method to process data from credit-card readers directly into a browser screen.

2) If the data is coming from a database, write an independent agent that runs on a workstation hooked to the printer. When you click the "print" button on the browser form, it sets a flag in the database. The agent periodically scans for this flag, and prints the resulting record. I've used this method for printing on Eltron or Zebra card printers. In fact I used MS-Access as the agent.

3
Hurda On

From a another 40,000 foot view - if its simple layout (one photo and few lines of text) and you do know which browser will be used to print - you can style it all via css.

I assume that the user actualy printing the card has the printer installed to his computer.

Also no promel what s so ever with printing barcode (it's justr an image - if reasnable good printer is used)