Here at Kindle Maps, I'm trying to make maps from OpenStreetMap and put them on the Amazon Kindle, like an off-line street atlas. EBook readers are great for text because you can reflow the text, and increase the font size, etc. However a street atlas will not have any of this because each page is one image.
Amazon seem to internally use a slight dialect of HTML to process the books. When they convert your book from PDF (or MS Word, etc.), they give you a zip file of HTML & images in this format. Rather than generate a PDF for Amazon to convert, I decided to use their HTML format directly.
Assuming you have a several images named
page2.png, etc., one image for each page, and you want each image on it's own page, the HTML file should be like this:
<html><body> <img src="page1.png" middle /><mbp:pagebreak /> <img src="page2.png" middle /><mbp:pagebreak /> <img src="page3.png" middle /><mbp:pagebreak /> <img src="page4.png" middle /><mbp:pagebreak /> </body></html>
Save that as
book.html (or whatever name you want) in a folder alongside all the image pages.
Amazon have a page on image placements, and I've added the
middle tag to the
<img… to get the images to appear centred vertically. Images should be less than 127KiB, however I've used images of 200KiB and it's all worked out. They might be downsized in the conversion process later, I don't know.
I'm using the
<mbp:pagebreak />, which is one of Amazon's custom HTML tags, which (obviously) inserts a page break and starts a new page. This should 'force' each image to be on a new page, rather than Amazon's convertor programme merging, cropping and combining images to wreck your images.
Converting HTML to .mobi for upload
Once you have a folder with the above HTML file and images, download KindleGen (scroll down). It's a command line programme for Linux, Windows and Mac OSX that converts that HTML and images into a
.mobi ebook file.
Download the .tar.gz, unzip it,
cd into directory with the HTML and images, and run the
kindlegen programme like this:
This will then create a file
book.mobi, a self contained file that includes all the layout and the images.
You can then preview this .mobi file on your Kindle and check that it all works OK, and then upload that file to Amazon's KDP.