[Solved] Chrome ctrl-P printing

'User made' tutorials related to Porteus Kiosk edition.
Official kiosk documentation can be find here: http://porteus-kiosk.org/documentation.html
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
sdlsupport
White ninja
White ninja
Posts: 5
Joined: 30 May 2019, 13:15
Distribution: Kiosk 4.8

[Solved] Chrome ctrl-P printing

Post#1 by sdlsupport » 30 May 2019, 13:21

Hi

Firstly - thanks for a great kiosk solution.

I have implemented a test kiosk in a factory situation which uses chrome to look at a web server directory of pdf documents - chrome opens them up perfectly on-click for viewing. Is it possible to allow printing of these documents to a shared network printer (on a CUPS server) using ctrl-P from within the browser without having to set a specific printer in the kiosk.

Thanks in advance
Martyn
Last edited by sdlsupport on 03 Jun 2019, 15:29, edited 2 times in total.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Chrome ctrl-P printing

Post#2 by fanthom » 30 May 2019, 17:02

Martyn,

I dont think it would be possible unless you could utilize 'Google cloud print' feature (i'm not familiar with it to be honest).
Please add [Solved] to your thread title if the solution was found.

sdlsupport
White ninja
White ninja
Posts: 5
Joined: 30 May 2019, 13:15
Distribution: Kiosk 4.8

Chrome ctrl-P printing

Post#3 by sdlsupport » 31 May 2019, 17:34

Hi

Thanks for the reply. So I tried this config.....

Code: Select all

kiosk_config=http://username:userpass@myinternalserver.co.uk/kiosk2.txt
connection=wired
dhcp=yes
browser=chrome
homepage_check=Homepage is not available - please contact your administrator
homepage=http://myinternalserver.co.uk
hostname=kiosk2
primary_keyboard_layout=gb
allow_popup_windows=yes
disable_private_mode=yes
right_mouse_click=yes
root_password=rootpass
screensaver_idle=5
shutdown_menu=reboot restart-session 
timezone=Europe/London
additional_components=uefi.zip 08-ssh.xzm 10-printing.xzm
browser_preferences=http://username:userpass@myinternalserver.co.uk/chrome-policies.txt
the chrome-policies.txt contains

Code: Select all

"CloudPrintSubmitEnabled": true,
My internal set up has a CUPS server on 18.04 with the cloud print connector installed (see here https://github.com/google/cloud-print-connector/wiki) to serve up printers locally. From all of the other 'fat' ubuntu clients Chrome returns a list of printers served by the CUPS server via the connector - I confirmed this but switching off the client CUPS system on one of the machines so that only Chrome showed printers at all. The kiosk does allow the print preview to open but no printers are listed. I used ssh to take a look at /etc/opt/chrome/policies/managed/chrome.json and can confirm that the CloudPrintEnabled flag is set to 'true' at the bottom of the file.

I also tried adding the following as opposed to the browser_preferences file method with no luck.....

Code: Select all

run_command=sed -i 's/"CloudPrintSubmitEnabled": false,/"CloudPrintSubmitEnabled": true,/g' $json
I can confirm that the kiosk is on the same subnet as the CUPS server and that I have tried with and without whitelisting my internal domain.

Any ideas as to why the printer list is not being populated from cloud print? Is there a step I am missing?

Thanks
Martyn

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Chrome ctrl-P printing

Post#4 by fanthom » 31 May 2019, 18:15

Martyn,

CUPS is not started in your setup (because printer is not configured) and probably thats why Cloud printers are not listed.

Please manually start CUPS daemon using:

Code: Select all

run_command=cupsd
or configure one printer and check if that helps.

Thanks
Please add [Solved] to your thread title if the solution was found.

sdlsupport
White ninja
White ninja
Posts: 5
Joined: 30 May 2019, 13:15
Distribution: Kiosk 4.8

Chrome ctrl-P printing

Post#5 by sdlsupport » 03 Jun 2019, 10:07

Hi

I tried both of these options. The cupsd command didn't seem to do anything so I configured a local printer

Code: Select all

printer_model=HP LaserJet Pro M402-M403n Postscript
printer_connection=direct
paper_size=A4
share_printer=yes
printer_name=LaserJet-warehouse
1. A local printer now shows up in Chrome and can print OK
2. No network printers are discovered, either through google cloud print or standard cupsd browsing
3. For some reason even though the kiosk printer is shared I cannot print to it using the ipp address

Note we have a master CUPS server for network printers - on each client machine we replace /etc/cups/client.conf ServerName parameter with the ip address of this master CUPS server, which works verys well. Is there any possibility of doing this on a kiosk?

I could test if I new how to restart CUPS on the kiosk but the following doesn't work after I SSH in.

Code: Select all

systemctl restart cups.service
If I could get this working it would be great to have kiosks with full access to network printing resources and no local printers.

Regards
Martyn

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Chrome ctrl-P printing

Post#6 by fanthom » 03 Jun 2019, 12:37

No idea why "could printing" does not work (maybe you need to login to google account first?).

You can update /etc/cups/client.conf using 'run_command=' parameter and 'sed' utility.
There are plenty of 'sed' examples on Google, please test it over SSH first.

Thanks
Please add [Solved] to your thread title if the solution was found.

sdlsupport
White ninja
White ninja
Posts: 5
Joined: 30 May 2019, 13:15
Distribution: Kiosk 4.8

Chrome ctrl-P printing

Post#7 by sdlsupport » 03 Jun 2019, 13:31

Thanks so much for your help

Sorry to be slow..... how do I restart cups in the kiosk?

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Chrome ctrl-P printing

Post#8 by fanthom » 03 Jun 2019, 14:20

Code: Select all

killall cupsd; sleep 2; cupsd
Please add [Solved] to your thread title if the solution was found.

sdlsupport
White ninja
White ninja
Posts: 5
Joined: 30 May 2019, 13:15
Distribution: Kiosk 4.8

Chrome ctrl-P printing

Post#9 by sdlsupport » 03 Jun 2019, 15:26

Hi

So I finally got there....

Added

Code: Select all

additional_components=10-printing.xzm
run_command=sed -i 's#/run/cups/cups.sock#192.xxx.xxx.xxx#g' /etc/cups/client.conf
to the config for the kiosk. Now a list of network printers appears and everyone is happy in my warehouse :D ...... no need for cloud print or even specifying a local printer which makes the solution super portable.

Thank you so much for your patience and help.
Regards
Martyn

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

[Solved] Chrome ctrl-P printing

Post#10 by fanthom » 03 Jun 2019, 17:12

Great - thank you for sharing.
Please add [Solved] to your thread title if the solution was found.

Locked