SeaPrint - Network printing for SailfishOS

Thanks for pointing to a2ps, i guess that is as standard as it gets. But wow, is it opinionated by default. I managed to dumb it down with a handful of switches - i want something simple enough to not get complaints on that it does something wrong. People whining about wanting it to do something more complicated are easier to dismiss :slight_smile:

Do you mean using actual QPrinter? I guess that is a no-go since it won’t be allowed in harbour (or i could make a stand-alone thing that uses it, but still). Or do you mean that wanting to render text on QImages sounds suspiciously similar to what i would have to do in order to make use of it? I guess that is what i’d prefer to avoid if reasonable.

I didn’t try the patches on SailfishOS version, I’ve created a MR to upgrade to latest upstream Calligra and apply the patches there, see https://git.sailfishos.org/dcaliste/calligra/tree/converter

It seems to work for the ODF files I tried it with. Is the ODF files you tried, open properly in the document application ?

1 Like

Hmmm, maybe it got fixed by someone else and came for free with the uplift. Or maybe the rebuild heuristics aren’t quite right and all files didn’t get recompile. Anyway, it doesn’t really matter really. Great job!

I failed, as always, to get git to actually show the right files. (fatal: remote error: Please use the https: protocol to connect to anongit) Maybe upstream had moved? Anyway git couldn’t just trust your repo and was being stubborn. Did i mention i hate git? :slight_smile:

So cloned anew and on to building, and here i’m pretty certain that it is a matter of PEBKAC… I’m building with a sfdk apply and sfdk build, and several dependencies could not be found… i guess that was a requirement for the uplift? But where should i have found those, and how do people that actually know what they are doing build things?

Edit: and i was just going to ask if we could/should propose to package calligraconverter in the official builds, but you go there first. Would be very nice if i didn’t have to maintain packaging that.

Well that’s indeed the idea that it gets compiled and distributed officially yes. I’m pretty sure it could, at least in a separated package, but hopefully installed by default (maybe).

For compilation, I don’t know, never used sfdk, I should but I’m accustomed to my routine of running the docker, and typing there mb2 -t SailfishOS-4.0.1.48-armv7hl -s rpm/calligra.spec build. It’s indeed doing all the download for the dependencies… I guess that sfdk is doing the same thing, but I’ve no idea and cannot help, sorry : ( I’ve seen in the release notes of the latest SDK that they fixed an issue with the docker not having the repository listing refreshed or something like that. Maybe it’s your case ?

The patches for Calligra have been accepted upstream earlier today, so tomorrow, I’ll rebase my work in SailfishOS on upstream/master and submit a MR for converter inclusion. We’ll see.

1 Like

Excellent news.

I still have to figure out why it doesn’t like the deps for this, but the old mainline version was just fine.
mb2 did indeed yield the exact same results.

I’ve just opened a merge request in SailfishOS git to add support and compilation of the calligraconvereter tool, see https://git.sailfishos.org/mer-core/calligra/merge_requests/56.

I could try to build it on OBS for easier testing on your side.

2 Likes

Thank you! I’ll build myself again tonight, and do an actual install with enough time to revert.

Just for the benefit of those following along here. I finally got the new version of Calligra to install, and it works great (as expected).
Now i can start plumbing it in to SeaPrint.

7 Likes

Oh wow, how did I miss this thread?! Thanks for creating and developing this app even further!

Now, if I only had a printer… :laughing:

1 Like

Still some improvements and clean-up left, but everything went quite smoothly.

1 Like

Great @attah. Thanks for your work, as @direc85 said I just need now to get a printer : -D

If you still have trouble with Calligra, don’t hesitate to share.

1 Like

@dcaliste, @direc85 I can only recommend to go with a laser printer that supports PDF natively, at least if you will mainly be using it for documents and similar. For photos, laser often doesn’t do a great job.

Good ones seems to be available already from €200. Make sure it has duplex, or you will regret it. If the reported issues are anything to go by Brother printers are a bit picky with formats and finicky in general, or really popular. Probably both. As you might have spotted, I have a fondness of OKI printers… not that they are especially awesome, but they have been consistently good enough so far.

If native PDF is not in the cards, look for “IPP Everywhere”, which mandates PWG-raster and JPG (for color printers). Anything that supports AirPrint should also work.

Thanks, will do! Currently it behaves.
Edit: or maybe not… I tried a presentation, and it segfaulted. You’ll get an email shortly.

For the curious among you…

As i’m not really aware of any problems currently, and 4.1 seems just around the corner, i have been holding off releasing this properly. But there are many new things coming in SeaPrint. Obviously odt and doc(x) support being the biggest (the dependency won’t come until SFOS 4.2, unless you build it yourself). You can now also save settings per printer, and raster compression performance has been improved 30-35%.

There has also been updates to the UI, with format icons on the first page, and visual separation of default settings and actual choices made.
(more detailed changelog on GitHub, even more details in the commits)

Feedback, especially on interacting with saving settings, and the UI updates would be much appreciated.

Related to all this there has been new strings added that are untranslated for the time being. So if you like SeaPrint in your native language, feel free to contribute.

6 Likes

A question/feature request:

Is .txt file printing support possible/doable etc.

(Apologies if it has been asked before)

Sort of. And i definitely agree it would be useful. (Mentioned it back in 25 Feb)

But there is a bit of thinking left to do. Not many printers support it natively, so there are two types of issues…

  • For those who do, it still seems i need to re-linebreak them with \r\n (maybe even reflow is desirable)… and i’m a bit sceptical to writing that code myself, but i can’t see any existing solution that will keep \f characters.
  • For those who don’t, i need to get it in to pdf. Some will need going on to raster, some Postscript, but those steps i have available to reuse. The existing tooling seems to start in Postscript, which isn’t optimal, and honestly taking on dependencies, especially that aren’t already in the repos, feels a bit silly for plaintext.

So if you want to help me think, let’s talk at some point.

The logic thing to do (at least sounds logic to me) is have something convert txt to a format all printers support.
However i have no idea about all those stuff and its better to ask help from someone that knows about coding.

:man_shrugging:

I didn’t try, but could the calligraconverter do the job ? It would handle the reflow for you and the paging also. It will then produce a PDF.

Good point, had actually not explicitly tested (just seen that sailfish-office doesn’t use Calligra for this), but it doesn’t seem to handle plaintext.

Unknown Calligra MimeType “text/plain”

I haven’t seen sailfish-office do pagination for plaintext, but the code kinda looks like it would.
However it doesn’t look very reusable for rendering to pdf or images, so probably it doesn’t matter…

You’re right it seems that Calligra converter cannot open plain/text mime type. That’s too bad. I’ll try next week to give a closer to look to see if it can be added simply.

Sailfish-office is using a specific handling for plain/text, that would not be convenient I think.

1 Like

You probably knew this already, but calligrawords does a great job both with files that needs reflow, and with ones that are more “formatted” plaintext, like RFCs. (Using the “as is” setting for end of paragraphs.) So if that result had be had in calligraconverter, that will definitely do the trick. I’ll just ignore native plaintext handling on printers and consider it a sub-genre of “office” documents.

Edit: no, scratch that, it is good but not perfect. They only mostly agreed on the amount of text that fits on a page. Sometimes it is off-by-one, and \f seems to have been ignored. :confused: