Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Category Archives: Kindle

calibre: How to convert and bind multiple html pages for kindle?

I tried to put  dive in python 3 on my kindle. Firstly I download sample from Amazon. The book is quite cheap, but well, … I would have bought it if it’s code blocks are actually represented as text (not as graph).

Then I tried calibre. Calibre is quite easy of use, but it keep telling me that

  1. html files should be known as “zip”
  2. The chapters should be ordered by chapter titles alphabetically, instead of original chapter number.

Luckily, calibre does provide command line too, namely, ebook-convert. It can automatically follow the hyperlinks and append the content of referenced local html files. However, it failed to recognize html files if they don’t actually have “<html>” tags (browsers render them fine, though). Well, inserting <html> and </html> on multiple files are not hard if you know sed and bash.

Are we done yet? No.  option “–breadth-first” is required, otherwise the chapter order is still messed up, as the latter chapters might inserted in the front just because they are referred first.

Are we there yet ? Well, yes. But of course, there are many knobs that can be tuned if you want better result.


The most easiest way to convert jpg/png files for kindle reading.

Recently I need to put some map files to my kindle, so I don’t need to bring lots of paper.
Kindle can read jpg, yet it only support certain resolution in certain depth.

After some search and research, I found that converting the jpgs to pdf is usually a good idea.

Converting jpg to pdf is simple if you have ImageMagik, like so:
convert *.jpg foo.pdf

That’s it.

Comparing “Send to Kindle” and “Later on Kindle”

I frequently visit sites that show source codes of programming language, so I compare the Send to Kindle and Later on Kindle, and see how they handle <pre> in this article.

Well, I admit it’s not a full scale test, so my test is bias.
Anyway, according what I saw:

  • On document selection, source field: Send to Kindle shows the host name of the site, while later on kindle shows, well “”
  • For normal <pre> tag display:
    • On Send to Kindle every lines seem to be joined together, like:

    • On Later on Kindle: lines are split like:
  • For “tabled” <pre> tag display (last code block):
    • On Send to Kindle, still every lines joined together, yet all the content is displayed:

    • On Later on Kindle, lines are separated, but truncate at right margin, you can only rely on either rotate to landscape view or use smaller fonts and margins.

To sum up, Later on Kindle generally better showing the pages with source code, but not good on long lines.