We have moved to a new Sailfish OS Forum. Please start new discussions there.
233

Printer support

asked 2013-12-29 16:52:59 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2019-08-11 22:49:35 +0300

BonoNL gravatar image

Allow users to print from all appropriate applications. Basically add CUPS support and make it configurable from the settings menu. Set printers according to used network etc.

Update 11-08-2019:

https://together.jolla.com/question/211124/collaborators-wanted-share-to-printer-plugin/

edit retag flag offensive close delete

Comments

3

Would be a cool feature :).

Sailor ( 2013-12-29 16:54:41 +0300 )edit
9

That would be nice and of course bluetooth printing too

Wizah ( 2013-12-29 16:57:25 +0300 )edit
1

hah, I was looking yesterday if this feature is available already in Jolla :D

yanoo ( 2013-12-29 20:38:30 +0300 )edit
1

Exactly the same here, wanted it yesterday :-) A cups installation with a print button in a lot of applications (Documents, Calendar, Email, Gallery).

hullabaluh ( 2014-02-05 12:08:39 +0300 )edit
1

Wanted to print something today, but then forgot that the device can't do it. Was already about to open a feature request, but then I saw this. So have an upvote instead!

Also wanted to propose device auto-discovery whenever you want to print something, similar to how printing to a networked printer works on Android.

ziller ( 2014-03-12 20:56:17 +0300 )edit

6 Answers

Sort by » oldest newest most voted
50

answered 2014-07-31 11:44:24 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2015-02-02 15:20:54 +0300

benna86 gravatar image

While we wait for official printing support there is a workaround to print any file from Jolla via command line, here's a step-by-step guide:

The first step is to enable developer mode, generate a password and then open the command line. To print we need to install the Cups printing daemon, unfortunately the installation is not straightforward due to some pre-systemd dependencies in the cups rpm package that are not satisfied by any package in the repo. We can start installing the dependencies that are available:

devel-su pkcon install cups-libs acl poppler-utils tmpwatch

after that we have provide the files /sbin/chkconfig and /sbin/service. I am not sure if this step is necessary but I wrote two small scripts that convert chkconfig and service syntax in systemd calls. Download them (chkconfig-script.sh - service-script.sh) into /home/nemo, make them executable:

chmod +x /home/nemo/chkconfig-script.sh
chmod +x /home/nemo/service-script.sh

and link them in place:

devel-su ln -s /home/nemo/chkconfig-script.sh /sbin/chkconfig
devel-su ln -s /home/nemo/service-script.sh /sbin/service

Once the dependencies are installed we can install cups. We have to download the package first

pkcon download . cups

and then we can force its installation ignoring the missing dependencies

devel-su rpm -i --force --nodeps cups*.rpm

Now cups is installed, we can configure our printer through the webinterface. Cups will ask to log in to the system and since, apparently, the group lpadmin is not created we have to log in with the user root, to do so you might need to set a root password:

devel-su su
passwd
exit

Once the printer is set up we can start printing. To do so we need to add the user nemo to the lp group:

devel-su usermod -a -G lp nemo

and then we can print any file with this command:

lp -d printerName -o fit-to-page fileName

I know it is not straightforward to print via command line but it works fine.

Enjoy printing!

edit flag offensive delete publish link more

Comments

4

Now all we need is the "Print" menu option in most spps ;)

pichlo ( 2015-01-10 13:18:06 +0300 )edit
4

Exactly! All the stuff with third party android apps is crap. Sailfish should be able to print directly an email or a webpage or a document. In the email app, in the browser, in the documents app, in the maps app...

NATIVE printer support. I have the samsung printer app installed but in all the sailfish apps this does not work. Why are we using a phone which is exactly not android to install all that android crap? In this case I can directly use an android phone, no?

hullabaluh ( 2015-01-12 15:13:03 +0300 )edit
2

devel-su rpm -i --force --no-deps cups*.rpm should be

devel-su rpm -i --force --nodeps cups*.rpm
Paavo ( 2015-02-02 03:56:58 +0300 )edit
3

Thanks! fixed. I also converted the post into a Wiki

benna86 ( 2015-02-02 15:21:27 +0300 )edit

Forgot to add that one should start the cups service before the web interface can be accessed: devel-su service cups start that's just the first time after installing all the packages. If you don't want the daemon eating up the battery, just substitute "start" with "stop".

Paavo ( 2015-02-02 15:45:48 +0300 )edit
4

answered 2015-01-09 21:52:40 +0300

martind gravatar image

updated 2015-01-12 14:38:27 +0300

The HP ePrint-App works fine for me. You do not need any account (HP ePrint, Google...) for use in your (w)lan.

edit flag offensive delete publish link more

Comments

And for Brother users there is an Android app called iPrint&Scan, for use on LAN.

flywheel ( 2015-01-11 19:10:37 +0300 )edit
2

I know this a bit old post but, I'm having an issue with the hp ePrint app on Jolla. When I start the app it would work like normal for something between 5 to 10 seconds before crashing. I actually was able to print a photo with it but it took quite a long training to be able to choose a right photo and make all selections in 10 seconds before crashing :D Is there any workaround or fix to be able to use the software? It seems quite legit thoughfor normal use.

Mrks ( 2015-02-23 13:39:34 +0300 )edit
1

I also had this problem with the HP ePrint app, waiting for any update to resolve the problem. Unfortunately it did not work out yet. However, I found out today, that there are also other apps from HP supporting printing over WiFi. By now, I ended up with this app: https://play.google.com/store/apps/details?id=com.hp.printercontrol and it just works fine for me (although scanning remotely is somehow not supported with my printer). No crashes anymore.

jollasaar ( 2015-05-09 15:57:28 +0300 )edit

Epson iPrint app (installed from Aptoid store) crashes on app startup. EDIT: Never mind, worked fine after reboot.

casanunda ( 2015-06-10 17:14:46 +0300 )edit
1

answered 2015-01-10 19:14:58 +0300

rburkhanov gravatar image

To print with any printer over cloud I installed Cloud Print plus app. To download apk from Google Play Store I had used this on-line service (there's also a plug-in for Google Chrome).

Works fine, but you have to setup your printer as a virtual printer in Google Chrome, and for this you'll need a Google account. There's an option to buy a pay version, but this seems like an unnecessary option ;-)

edit flag offensive delete publish link more
3

answered 2018-09-30 14:42:43 +0300

updated 2019-04-09 21:50:28 +0300

does this 'still' work for peeps? on sfos 2.2.1.18

installation went fine

instead giving root a password I added the group lpadmin and added nemo

groupadd lpadmin

usermod -aG lpadmin nemo

logon and configuration of HP Deskjet via socket went fine (set it as default)

but then I got stuck with

$ lp gdb.txt

lp: Unsupported document-format "text/plain".

even

echo 'hello' | lp

gives the same

also print test page only yields:

Unsupported format "application/vnd.cups-banner".

something missing?

cups-filter or ghostscript-cups are the obvious ones. but...

bump: really no one has an idea?

edit flag offensive delete publish link more

Comments

2

I would really like to get it running on my Jolla, but ...

BTW: why did this topic/question came to the current list? I scanned every answer and comment but all is old (newest mine from Oct 18). I never understood this method how to keep track here on TJC! :(

peterleinchen ( 2019-02-18 01:31:52 +0300 )edit

In fact, I wonder why printer support seems so unpopular. I have posted a recent feature request regarding printer integration and have been referred to this. Is there any news regarding this topic?

sailaway ( 2019-07-22 08:02:50 +0300 )edit
17

answered 2019-12-18 21:20:10 +0300

attah gravatar image

updated 2019-12-18 23:11:15 +0300

Today my app "SeaPrint" was published in store. It is a basic IPP (Internet Printing Protocol) client. It also does mdns/dns-sd "Bonjour" printer discovery, and allows adding non-advertised printers manually. It only does PDF and JPEG, and only if they are supported natively by the printer (or CUPS instance) you are printing to.

I am considering PWG raster, and possibly Apple/URF raster, but that will not add significant format support (since rendering would need to happen client-side), just more compatible printers. There is a basic set of print job settings exposed, and some more will be added along the way.

image description

Find it in store, do try it out, but bear in mind this is very much in beta. Feel free to leave feedback here, but formal bug reports are better done on https://github.com/attah/harbour-seaprint

And perhaps most relevant to this question: i aim to make it deployable as a share plugin too, but for now i am prioritizing having it harbour friendly over a super-optimized workflow.

edit flag offensive delete publish link more

Comments

One small suggestion. Make the file chooser default to Documents. And i also don't think it needs a system files option.

Even if i stopped printing stuff ages ago this is a really useful app. Thanks.

ApB ( 2019-12-18 22:21:43 +0300 )edit

@ApB: Thanks, i did look for that option in the documentation, but didn't find it (since it isn't documented :). But now looking at the source code of the FilePickerPage, it is indeed possible.

attah ( 2019-12-18 22:31:53 +0300 )edit

Great, thank you. I appear to have difficulties finding my printers though. I have an Epson XP-55 connected to my network an an HP 1320 connected via a Kubuntu desktop to the same network. They do not appear in the app and I do not know how the printer URIs. At least the XP-55 is advertised via dnssd, as the Kubuntu machine did find it this way... Any suggestions?

ausgeregelt ( 2019-12-19 08:40:33 +0300 )edit

Thank you for this app. Printing with my Xa2 was already possible with the "HP Print Service Plugin". However, it didn't work on the Xperia X. Now the printing works with both devices. But it is much more important to me that I can now do without an Android app. Thank you very much for that. I only tested the app briefly. PDFs can be easily printed.

sailaway ( 2019-12-19 09:45:37 +0300 )edit
1

@ausgeregelt Thanks for your report. That's too bad it isn't working for you. If you are feeling up for it, you could look at your network traffic with Wireshark and see if the printer is responding. I have added debug printouts (coming in the next version) of any received address records, since perhaps my cross-correlation of service to address might be off. Look for "IppDiscovery::readPendingDatagrams" in the logs. Or maybe you are running pure ipv6, i haven't bothered with that yet...

Generally printers have their ipp server at {some ip}/ipp/print (SeaPrint sets the correct default port of 631). CUPS installations generally have them at {some ip]/printers/{printer name}. To find that printer name you can browse to localhost:631 on that machine and check. You may also have to edit your CUPS config to allow external clients to use it. (google can explain better than i can)

attah ( 2019-12-19 21:23:20 +0300 )edit
0

answered 2019-12-19 22:08:57 +0300

SebM gravatar image

updated 2019-12-21 02:52:29 +0300

First you will need sudo and zypper so if you have not installed them yet :

echo "=> Installing sudo and zypper ..."
which sudo || devel-su sh -xc "pkcon -v refresh;pkcon install -y zypper sudo"
groups | grep -wq sudo || { devel-su sh -xc "sed -ri '/%sudo/s/^# //' /etc/sudoers;groupadd sudo;usermod -aG sudo $USER";exit }
sudo zypper -v refresh

Then you can install cups with these commands :

echo "=> Installing cups ..."
wget -O service-script https://www.dropbox.com/s/21ah44ummyn8rdw/service-script.sh
sudo mkdir -vp /usr/local/sbin/
sudo install -vm755 ./service-script /usr/local/sbin/
rm ./service-script
sudo ln -vs /usr/local/sbin/service-script /sbin/service
sudo zypper -v install cups # This will install almost all of cups-1.5 dependencies (including the "chkconfig" package) except the "/sbin/service" which we installed earlier
groups | grep -wq lp || { sudo groupadd -g 108 lpadmin; sudo usermod -a -G lp,lpadmin $USER; exit; }

Now you can configure SailfishOS to connect to your printer like this :

$ sudo lpadmin -p myPrinter -o 'Two-Sided Printing=DuplexNoTumble' -v ipp://x.y.z.t/ipp/printer -P ~/cups/ppd/myPrinter.ppd -L Home -E
$ lpstat -v
device for myPrinter: ipp://x.y.z.t/ipp/printer
$ lpoptions -d myPrinter >/dev/null
$ lpstat -d
system default destination: myPrinter
$ sudo systemctl restart cups
$ systemctl status cups 
echo "=> Now you have to add a printer with <lpadmin>."
edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
33 followers

Stats

Asked: 2013-12-29 16:52:59 +0300

Seen: 9,504 times

Last updated: Sep 02 '20