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.

3 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.

8 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.

9 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: