Printing into Local Thermal Printer from HTML5 App

6,131 views
Skip to first unread message

Raman Venmarathoor

unread,
Jan 21, 2014, 6:47:28 AM1/21/14
to native-cli...@googlegroups.com
Hi,

I have a web based kiosk application (HTML5 SinglePage Frontend and LAMP on remote server) running for a client. 

It currently uses the java applet jZebra http://qzindustries.com/ to print to the local printer. It allows me to select specific HTML code (part of DOM) and sent it printer.

My Questions are:
  • Is it possible to use native client for printing to the local printer?
  • If yes, are there any free/paid native client implementations of the same?



Thanks 
Raman

Nick Bray

unread,
Jan 21, 2014, 1:40:21 PM1/21/14
to native-cli...@googlegroups.com
This is largely an API issue.  NaCl apps essentially get the same APIs as JS apps.  NaCl allows you to run native code in the browser, but safely.  You cannot access arbitrary files on disk, rather you must route your requests through the browser.

It is likely that if what you want to do is possible, you can do it from JS.  A quick search comes up with this:
http://stackoverflow.com/questions/3056876/print-from-chrome-without-the-print-dialogs-using-greasemonkey-userscript-maybe


--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Raman Venmarathoor

unread,
Jan 22, 2014, 6:33:17 PM1/22/14
to native-cli...@googlegroups.com
Thanks for the reply.

I want the kiosk to print to any chosen printer on without any user intervention. 

Setting a shortcut with kiosk arguments (setting below) allows chrome to launch fullscreen and print without user intervention. but still, chrome will show it's print preview for a second or two. On a 42" kiosk screen that will definitely show. Right now the jzebra java applet allows me to bypass it. But I want to avoid using java applet.

"<path-to-chrome>\chrome.exe" --chrome-frame --enable-kiosk-mode --kiosk-printing --kiosk --hide-scrollbars --user-data-dir=<alternate-path-to-chrome-data> <site-url>

I have been to that post on stackoverflow quite earlier.

Regards
Raman

Andrey Khalyavin

unread,
Jan 23, 2014, 3:38:49 AM1/23/14
to native-cli...@googlegroups.com
Generally, if you need more permissions that chrome allows, you should use Native Messaging API or Socket API. This approach allows to send arbitrary data to the native program which in turn can do what chrome can't do. It may not be easy to use this approach for printing though since javascript/Native Client do not have access to the page image.

-- Andrey Khalyavin
Reply all
Reply to author
Forward
0 new messages