6

I'm using Calibre the ebook viewer to view PDFs, DjVu, and ePub books. I don't know what version the program is, since I couldn't find any about dialog to confirm it. But I downloaded a couple of weeks ago. There was a update very recently which I installed, so this could be due to bad installation or something like that.

My problem is when viewing ebooks with Calibre viewer, two things happen:

  1. If I try to choose them with Calibre open from my library, then they never finish loading.

  2. If I open them from Windows, and I choose to "open with" Calibre the ebook viewer, the result is that they are displayed very badly, with a ugly standard font, with equations all ugly, It easier to show it so I will copy some images comparing how it's viewed with Calibre vs other viewers that work fine.

Calibre with a DjVu, all the pages looks like this:

how calibre wrongly displays a djvu

Other viewer (not calibre) can format equations, of the same ebook, and displays the whole book correctly, this is how it should look: how the book should look, with nice equations, completely readable, like a scanned ebook that it is

I don't understand if Calibre is having a bug or if it's converting ebooks to some basic format. I don't understand why this happens. Help me to view books correctly.

Edit (day 06/ month 05/year 2016): I filed a bug report and got a response from the developer.

Santropedro
  • 163
  • 7

1 Answers1

3

When the DjVu support for Calibre was added a few years ago, it was implemented by taking the text layer, when available, and extract and convert that to textual material usable for conversion, by Calibre, to other formats. When available it uses the C++ based djvu2txt from the djvu-libre toolset, otherwise it uses a, much slower, decoding done in Python.

That text layer can be generated when "printing" to DjVu, but it normally is built from the image material that you get when you scan files to the DjVu format. And the layer allows you, in most DjVu viewers, to select something on the image and then either copy the image rectangle or the associated text in the text layer.

What you see in WinDjView is the image layer in your DjVu file, what you see in the EbookViewer is the text layer. The text layer has some positioning information (otherwise a viewer would not be able to associate text with a picked area of the image data), but most of that is discarded and only used to make paragraphs.

When I wrote the original DjVu support for Calibre (several years ago), I did so, to make it possible for conversion as indicated above. I had no idea that this made it into the Calibre ebook-viewer. The ebook viewer should directly use the image data, but it obviously doesn't (and that is even less trivial than writing a Python based extractor of the text layer).

I tested viewing a DjVu file without text layer on a recent version of the Calibre ebook viewer. It shows nothing, which confirms my expectation. It could be that the ebook-viewer just picked up the DjVu plugin by using the same interface as the convertor, that would make sense, but in the case of DjVu files that is not the right approach. IIRC there was no way to provide such a plugin and tell Calibre it should only be used for conversion (and not for display).

You're not doing anything wrong. I would rather say this works as can be expected knowing the implementation, but that doesn't make it very useful for books that are not paragraph oriented. So in your words: it is converting the books to some basic format. And this is not easily/quickly fixed.

guntbert
  • 103
  • 2
Anthon
  • 7,641
  • 3
  • 23
  • 56
  • I am hugely grateful that YOU are answering given the fact that you were involved in calibre directly, I am very happy and I thank you for writing that software!!!! So, there is no solution except using another viewer to view calibre files? This seems like a huge usability bug on calibre, since the project claims to be a solution for all your ebook needs, but can't show djvu how it's supposed. Am I right? – Santropedro May 29 '16 at 17:06
  • Most people aren't interested in viewing books in text layer I guess. At least there should be a clear option, even by default, to show image layer. Am I right? I need your help to know if I'm understanding the situation correctly.

    So, I want to tell calibre developers, what do I say to them? I want to contact them and tell them in Windows 10 this does not work. I will give you more data: Calibre does not open pdf: it crashes. This is ridiculous. What means "printing" to djvu in your second paragraph in your answer? I understood your answer don't worry!!!

    – Santropedro May 29 '16 at 17:06
  • Sorry for being unclear. Thanks for telling me that I'm not doing wrong becayse then I will change to another viewer. Now, should I report usability bug? How it's possible they overlook such a basic feature? Possibly there is something wrong with windows 10? I know you can't answer this. But it seems super misterious, Well thank you a lot !!! – Santropedro May 29 '16 at 17:10
  • The image layer should be the one shown by default, but that is not implemented (at least not by me). It doesn't work at all (I work on LInux). With the PDF you might have the same issue: that it is images only. With printing I mean from Word or some similar program print directly to a DjVu file, then it is easy to add the text layer to the image layer. But most DjVu files come from scans. – Anthon May 29 '16 at 17:11
  • You can file a bug, but for text only books without much layout this behavior is IMO better than not showing anything at all. I think it might be difficult to programmatically tell if displaying the textlayer makes sense or not. Best would be to have image display, but the djvu libre library is C++ and horrible to use. And I only rewrote the text decoding part in Python (and C). – Anthon May 29 '16 at 17:15
  • Yes, Linux is badass, I also have it! Same issue with pdf? interesting. Your use of the word printing is not the same as this on wikipedia, that confused me, now I imagine you take a file and convert it from word to djvu, by creating images files but also the layer text, because indeed word stores letters and so text is readily available, in comparison to scans, in wich have to be recognised by a smart ODR. Thanks. – Santropedro May 29 '16 at 17:17
  • On the other hand filing a feature request asking that you can specify some third party viewer in Calibre for DjVu files would make sense. I think I'll do that. BTW for scanned papers DjVu is by far the best format: multipage and small image size, far better than PDF or TIFF. – Anthon May 29 '16 at 17:17
  • Yes I imagine you may find a use for this. I understand that something better than nothing and I agree on that hugely. But you should have the option. I'm thinking that you maybe have and I don't see it. – Santropedro May 29 '16 at 17:18
  • No I don't have that option, I don't see the image layer either nor can I (AFAIK) specify an external viewer for the DjVu format. – Anthon May 29 '16 at 17:19
  • Try this (on windows 10 works): right click on a book cover > view > view specific format > open pdf with (if its pdf). This is what you need I think. There you can browse a new program for opening. – Santropedro May 29 '16 at 17:23
  • There was a misunderstanding. When I meant "but you should have and option" I mean "it would be nice if the program had that feature of viewing the image layer." and when i said "you maybe have and i dont see it" I meant "maybe there is a feature and i dont see the button". With "you" I meant not Anthon but the program. – Santropedro May 29 '16 at 18:08