[Testing] Djvu documents support in sailfish-office

Hello. There’re a lot of djvu documents around.

Could you please implement support of this format or if you don’t have time for this It’d be very helpful to have some some brief explanation how someone might be able to do it?

2 Likes

I have made something called "Djvu Viewing helper " available from OpenRepos.

It’s a very kludgy workaround in that it converts djvu to pdf and then opens that.

I agree a native plugin would be good but for viewing DjVu documents now it may be useful.

2 Likes

It seems DjVuLibre has Qt bindings, so supposedly making a viewer app should be pretty easy once you have the libs built (which it looks like you got sorted).
But the repos and documentation are all over the place with api documentation completely missing… so who knows.

DjVu is quite niche… so maybe a dedicated viewer app is the way to go, but none the less experimenting separately from sailfish-office to just have it running is probably a good idea.

I have dabbled in doing that quite some time ago, and the Qt “djview” application does compile and run but is not usable because of its non-Sailfishy UI components.
I gave up on that project because of my utter lack of C++ or qt skills.

But I agree, someone could make a native viewer probably quite easily.

1 Like

Hello agian.
Thanks for the answers.

So I’ll try to impement this support in sailfish-office as a hobby project for fun and will report here the progress.

As a first step I made a repository which builds three packages

Spec for the build taken from openSUSE and slightly tuned for SFOS.
I tested it over latest SDK, looks good.

This is already useful because djvulibre package has several cli programms/utilities which might be helpful for users.

If you think that those packages are already might be useful for YOU feel free to convince Sailfish OS maintainers to include them as part of official Sailfish OS repositories, here in the thread or on github:

Tools are (CLI):

  • bzz - DjVu general purpose compression utility.
  • c44 - DjVuPhoto encode.
  • cpaldjvu - DjVuDocument encoder for low-color images.
  • csepdjvu - DjVu encoder for separated data files.
  • ddjvu - Command line DjVu decoder.
  • djvm - Manipulate bundled multi-page DjVu documents.
  • djvmcvt - Convert multi-page DjVu documents.
  • djvudump - Display internal structure of DjVu files.
  • djvups - Convert DjVu documents to PostScript.
  • djvuextract - Extract chunks from DjVu image files.
  • djvumake - Assemble DjVu image files.
  • djvutxt - Extract the hidden text from DjVu documents.
  • djvuserve - Generate indirect DjVu documents on the fly. (CGI program)
  • djvused - Multi-purpose DjVu document editor.
  • cjb2 - Simple DjVuBitonal encoder.
3 Likes

Nice!

Hope you can make that office plugin work, good luck for that!

There would have been a build of djvulibre available here:

because I was on the same path a couple of years ago :slight_smile:

Anyway, should you succeed in making a office plugin let me know how I can change, adapt, or move out of the way those builds in case that’s necessary.

1 Like

Hello again.
I’d like to share some progress.

What is ready:

  • new djvu plugin structire is ready and integrated into sailfish-office
  • djvu plugin is able to open djvu files and render them

In work:

  • right aspect ratio for documents and zoom
  • toc
  • autosave position in file (like in pdf)

How it looks right now might be seen on this short youtube video: sailfish-office early work on djvu plugin 2022 01 29 - YouTube (next time will try to figure out how to record only required space).

Thanks.

p.s. Thanks for sharing @nephros this is helpful, just realized that I missed some mimetypes.

5 Likes

Hm. Last two messages have been removed. Without warnings and explanations, so nice.

The djvu extension is ready and pull request has been created. Packages for testing might be found on github.

1 Like

The forum was restored from backup due to accidental software update, nothing malicious

1 Like

Oh, I see. Makes sense. Thanks!

1 Like

But yeah a bummer the post is gone as it had the pull request link and a beta version for testers, could you repost those?

Doesn’t work for me, but I’m on 4.2 so there are some binary incompatabilities with that build.

1 Like

Tested now on a 4.3 Gemini. Works brilliantly, thank you very much!

I wonder though whether it’s possible to compile and package just the djvu plugin, and distribute as an addon package.

The initial comments on the original PR/issue didn’t inspire confidence that upstream is interested in merging this.

3 Likes

Hello again!

I wonder though whether it’s possible to compile and package just the djvu plugin, and distribute as an addon package.

This is possible and impossible at the same time.

This is possible because djvu part compiles as a separate plugin,
but impossible because right now to add a plugin you need to add a link on your plugin to the several files from the main project.

Status of this right now is blocked by upstream with the reason “because of the marginality of the format”.
If you disagree with that statement or would like to try to convince upstream maintainers to have this plugin as part of the main distribution feel free to do it in this discussion:

3 Likes

Hello again!

On Aurora OS there is no such thing as sailfish-office, but djvu viewer is still very welcome. So I finally made a DjVu Viewer as a separate app. The same app ported to Sailfish OS and published in Jolla Store.

Happy to say that the app approved today, so this piece of work is finally usable.

Thanks!

6 Likes

Lovely, thank you!

Works nicely!

1 Like

Works perfectly fine, thank you!

1 Like

I guess I can retire my Rube Goldberg hodgepodge app “DJview viewing helper” on Openrepos now. Good! :slight_smile:

@nephros Your solution still might be useful.