Create Kindle book programmatically using C#?
Asked Answered
H

2

16

I have an idea for a project but it will require being able to create Kindle books on the fly on the server and preferably in .net.

I haven't found any libraries to do this however. I see that there are epub libraries, but these would then still need to be converted to azw.

Is this possible, and if so does anyone have any pointers please?

Handcrafted answered 27/4, 2012 at 6:40 Comment(0)
B
14

I am doing something similar. One way to go about it is:

  1. Create a specially formatted HTML file with your book (see info on kindle formatting guides below); and
  2. Use the command line Amazon KindleGen tool to generate the eBook.

As far as creating things like the Table of Contents, starting chapters on a new page, and other things that can be accomplished in a Kindle eBook, you may want to read a kindle formatting guide, such as the Amazon Kindle Publishing Guidelines.

Also, you may want to read a book by a third party on the subject. I have personally read Kindle Formatting by Joshua Tallent and How to Format Perfect Kindle Books by Steven Lewis and they both contain the information needed for properly formatting a kindle book using an HTML file. You can obtain both books from Amazon. The Tallent and Lewis books are aimed at authors that may have never created an HTML file by hand and guide you thru the process.

Betts answered 27/4, 2012 at 7:16 Comment(3)
Hi Six. Can the KindleGen library be run on a server and called programmatically through dot net code?Handcrafted
Sam take a look at #206823 for info on how to execute a command line program in C#Betts
Yamir - perfect! I'll try this.Handcrafted
H
5

You can try with Calibre. It has support for .mobi file format.

If you are already able to create an EPUB file, use the Calibre command line tool ebook-convert.exe:

ebook-convert.exe c:\file.epub c:\file.mobi --output-profile=kindle

As an alternative, you can produce PDF files, as they are supported by Kindle.

Handset answered 27/4, 2012 at 7:3 Comment(3)
Please could you update your answer with details on how I can use Calibre to create .mobi files using .net.Handcrafted
If you are already able to create a epub file, use Caliber command line tool ebook-convert.exe: ebook-convert.exe c:\file.epub c:\file.mobi --output-profile=kindleHandset
Thanks for updating your answer Jaime. Possibly why you got the downvote from someone.Handcrafted

© 2022 - 2024 — McMap. All rights reserved.