Ranjeeth Rao
Ranjeeth Rao

Reputation: 155

Printing on POS from Angularjs client

I have developed a token dispensing system (web based POS) with key component being a kiosk screen with angularjs on the client side and Java/Springs on the server side. The kiosk setup would be a normal (Win OS) Google Chrome browser window running on full screen mode, fitted with a thermal printer to print token slip.

The kiosk will dispense a token slip when the user clicks on a button (say 'Get Token') on the screen. The slip will contain a token number, a barcode and other miscellaneous info (like timestamp and kiosk id). The barcode has to be generated from the data I get from server side API call.

What I am looking for is a solution to silently (without print preview) print a token slip on the thermal printer connected to the client (kiosk) when the user clicks on a button on the kiosk screen.

Creating an iframe on-the-fly or binding values to a pre-defined html template is not helping since the data to be printed is not just plain text. It also has the barcode.

Any help would be much appreciated!!!

Upvotes: 0

Views: 2622

Answers (1)

Quan NDA
Quan NDA

Reputation: 36

I haven't try completed solution as your demand, but you can try 2 separate steps below:

  1. From server side API, you should generate an PDF for exactly expectation print version as you want (mPDF is my best recommendation) .
  2. Disable print preview mode in google chrome with start up parameter "disable-print-preview" (make your own shortcut at the desktop to run Chrome without print preview mode. Then using javascript to do the print like you did with iframe or new window.

PS: a good tip for a shortcut from techlogon: http://techlogon.com/2012/03/29/how-to-disable-print-preview-in-chrome/

Upvotes: 2

Related Questions