I apologize from hopping from thread to thread with this djvu subject. Hopefully this thread will be the good one.
Question: I would like to be able to convert an EPUB to a fixed size djvu file as easily as I produce 9×12 PDF using the Prince PDF plugin when a simple click triggers a conversion script managing the options.
1. - about the qualities of the djvu format
What motivates this search is the fact that a djvu file could be much more compact, at least for some illustrated books, compared to a pdf one. If I judge from my limited experience (I use only Prince PDF to convert Epub to PDF) a text-only PDF can reach a very big size compared to a xhtml one. I consider a 200% to 300% size increase to be, on average, acceptable, but sometimes I get much higher percentages. An alternative solution could sometimes be useful and that's why I try to make up my mind about the usability of djvu.
As far as readability is concerned, if one select a good-enough resolution (300 dpi is default for bitonal images), I don't think bitmapped images from djvu can be a problem. Have a look at the wonderful
Alice in Wonderland that Wikimedia choose to illustrate the capabilities of this format. Furthermore, even if it cannot compare with the gazillion tools available for the PDF format, the use of djvu, at least with Linux, is still comfortable. Koreader which is my reader tool of choice on my PW3 reads very well PDF but also DJVU files. Note also that the text is easily searchable at least with tools like Djview4.
Alice in Wonderland (attached below). This is a 3.5 MB book containing 114 pages with 57 images (14 of them full screen ), with an average size of 31 k by page. I wonder if one could achieve such a result even with an optimized PDF. I fail to see why it would not be advisable to convert directly some kinds of EPUB books like this one if I obtain a size advantage compared to PDF.
There are dissenting opinions about this though, for example from willus
Quote:
I don't recommend the djvu format for converting your epubs into fixed page format unless your epubs are mostly images. With text-based epubs, converting to djvu creates a bitmap for each page, whereas converting to PDF should store the text from the epub directly as text strings (as convertio does) without the need for bitmaps. This results in a very small PDF file size when converting large, mostly text epubs unless those epubs have a lot of different fonts that get embedded into the PDF. This is probably why the pdf2djvu utility ends up creating a larger djvu file than the original PDF file. There is also the added benefit that the text in the PDF file will render perfectly (with smooth edges) at any magnification, whereas the text in the djvu bitmapped pages will not.
The djvu format is optimized for archiving scanned documents, not for converting epubs.
|
The same recognizes that the most efficient compression level for PDF (JPEG-2000, or JPX encoding) is reported to be a "viewer killer" due to its slow rendering. A quick rendering would be provided with a PDF five times this size.
2. - about producing djvu files
This is a summary of what I tried.
Many organizations use djvu for the storage of electronic documents because of its size saving features. I did a few tries to check it. As I am a Linux user, I used the handy
pdf2djvu conversion tool with a 300 dpi resolution. I got the following results:
- a 7.2 MB pdf became a 13.3 MB djvu. It contains 99.8% text and one cover image.
- a 26.5 KB pdf black and white image (300 dpi) became a 37.6 KB djvu.
- a 2.8 MB pdf colour image (600 dpi) produced by my scanner printer became a 176 KB djvu image (300 dpi)
Out of the third test, these tries do not seem very enticing as far as size saving is concerned.
Using
djvudigital (and a compiled
gsdjvu from an AUR package), a 1.2 MB 9×12 PDF resulted in a 1.6 MB djvu (300 dpi) which is marginally better than the first try but not yet satisfactory. It contains 99.8% text and one cover image. However, a Gallica PDF scan went down from 22 MB to 18.7 MB when converting to djvu with
djvudigital.
So, for the time being, it seems it does not make much sense to start from a pdf to produce a djvu save for some rare use cases like this unoptimized colour image mentioned above.
The problem is that I do not know how to convert
directly EPUB to a customized (9×12 cm) djvu format. Up to now, I found that the online site
convertio converts directly nice documents in djvu format from epub but does not seem to offer any free choice for dimensions(it produces standard A4 files). It sells a "conversion API" choice but I am not sure if the "ouptput format" option applies also to djvu.
Other sites pretending to convert Epub to djvu do much worse. Sobolsoft uses a two step process, converting first to a temporary PDF and them converting to djvu. As you can read above, It's easy to do the same, for example using Jellby's plugin and then the excellent opensource
pdf2djvu or
djvudigital software. But as the output djvu file exceeds the PDF size this defeats my initial purpose...
Hopefully one day, a new plugin may appear which may enable us to go directly from epub to djvu format.