3

Does anyone know a way to silent print via a Chrome App?

I'm developing a chrome app for a KIOSK system which runs Chromium OS. I need to print a receipt via a Chrome App, which I already did. The problem is that print dialog box appears once print process is started.

Is there any way around this?

Xan
  • 74,770
  • 16
  • 179
  • 206
amilaishere
  • 408
  • 8
  • 21
  • Check my answer http://stackoverflow.com/questions/22357398/google-chrome-app-print-slient/32435013#32435013 – kadir950 Sep 07 '15 at 10:01

4 Answers4

3

This is IMPORTANT INFORMATION about kiosk mode Chrome app

Kiosk parameters can not be useful when you install app in developer mode (1) ( Parameters = "kiosk_enabled":true and "kiosk_only":true located in manifest.json )

But the parameters work after install the app from Chrome Store. Therefore be careful about this trick.

Now my kiosk app can run full screen and silent print (without preview).

enter image description here

1) http://lifehacker.com/install-chrome-extensions-from-outside-the-store-with-d-1596918011?disableinsets=off&utm_expid=66866090-49.VYy4WCNHSyuP6EmjnM93MQ.1&utm_referrer=https%3A%2F%2Fwww.google.com.sa%2F

kadir950
  • 117
  • 12
1

I found a temporary (maybe not temporary :) ) solution for this subject:

SOLUTION FOR CHROME APP

Install your App to chrome

Create shortcut from this app to desktop.

Right click > Properties > Edit Target Textbox like the below (you will add "--kiosk-printing" parameter )

Before Edit: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 2" --app-id=eoaefbbbpgcbhgeilphgobiicboopknp

After Edit: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk-printing --profile-directory="Profile 2" --app-id=eoaefbbbpgcbhgeilphgobiicboopknp

Absolutely restart chrome for effect (close every tabs and windows on chrome) Try to print

If you want to remove default header and footer (page address and date) : Open normal chrome print something > on printer preview > More Settings > uncheck "Header and Footer". Chrome ll remember this settings always.

(In fact chrome must provide this property on manifest.json too, but i couldnt find yet)

kadir950
  • 117
  • 12
0

Sorry man, it's not possible.

But you could evaluate some workaround: install a web server, make an httpRequest, and then print using a server side language.

In my case, I used php to receive the http request from the chrome app, and then, from php, I launched a java app for the print. I used java because with php (php_printer.dll) is not possible to print images (it's possible to print bmp, but the process to convert a png to an bmp is too long).

I know, it's a little tricky, but it works.

cark
  • 254
  • 2
  • 9
0

If you're specifically targeting Kiosk mode apps, you just need to set a flag.

Specifically, --kiosk-printing

I'm not 100% sure how to do that on a Chrome OS device in Kiosk mode. Maybe you need to set it at chrome://flags before switching to Kiosk mode.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • I'm pretty sure there's a way to make this work (because this was specifically added for your scenario!), I just don't know how to properly activate the option on Chrome OS Kiosk mode. – Xan Jul 22 '15 at 13:14
  • Thanks. I installed ubuntu server on my KIOSK machine. I tried --kiosk -printing. but it did not work. I'll post here If I find anything. thanks. – amilaishere Jul 23 '15 at 04:42
  • @amilaishere Care to share what went wrong and what you eventually fixed? – Xan Sep 07 '15 at 12:34
  • It's being a while . But As I remembered firstly I tried it with windows OS. Since our kiosk system runs on a Ubuntu 14.04 I was working with linux. Eventually It has worked. – amilaishere Sep 08 '15 at 04:25
  • @xan This is only for chrome apps? It does not appear to work on chrome browser on os x 10.13.6 – Daniel Lizik Nov 08 '18 at 07:55