Saturday, July 27, 2013

If Only I’d Known at the Start, How Simple It Would Have Been: KindleGen

I think I’ve figured out KindleGen, the Amazon-approved creator of .mobi books for its Kindle devices. As it turns out, KindleGen is, in my opinion, simple. Simpler, in fact, than MobiPocket Creator. I wouldn’t have said that when I started, but my difficulties were the result of “mechanics” and not the program itself.

I began my effort trying to use KindleGen’s “command prompt” feature and after two days of failure, used what some bloggers consider the easier process of uploading the book files into Amazon’s Kindle Previewer. After an hour or so of trying to figure out how to use the Kindle Previewer in this capacity, I did build my book. After sleeping on what I’d done and considering the files used during my success with the Previewer, I returned to the “command prompt” screen and tried that method again. It worked, too.

I’m gonna briefly describe my ordeal, then show you the steps I used to create my book using both the Previewer and the “command prompt” line in my computer. Keep in mind, this post isn’t meant for those who understand the workings of computers and command prompts or even the placement of files in folders, though you folks might enjoy a good laugh from the read. Any helpful comments from that audience are appreciated, too. No, this post is intended for folks like me who are “clueless” when they read a blog or forum post that takes for granted the reader understands what the writer is talking about, without step by step instructions. I hope my new-found discoveries prove helpful to some of you out there. I use the term “discoveries” on purpose, because I do not necessarily understand what I have done.

KindleGen is a free download from Amazon (more on that below) and uses a “command prompt”. You may remember the “command prompt” from the dawn of personal computers, when the owner had to boot-up the computer on a black screen using letters and symbols (i.e., < > : \ \). Despite the fact that computers now magically boot-up themselves without the help of the computer helpless, command prompts are still in vogue with those who know how to use them (not to mention know where to go to find that black screen). I’m told the “command prompt” is a powerful feature in the right hands. As regards, myself, however, I spent the better part of two days  struggling with the guidance provided by the ebook formatting company eBook Pioneers in its March 2013 blog  and could not get Camellia Creek to build. I did attempt the methodology used by a couple of other bloggers, similar to, but different from that of eBook Pioneers. The results were no better.  

I had created five files to “build” my book: the .html of my book; its .opf; its toc.ncx; cover graphic; and logo graphic, and I figured they all needed to be in the “prompt” line. I considered with each fail that I was not listing my files in the “command prompt” correctly or I was placing them incorrectly in folders. I also thought the problem might be Windows 7. I swear, as many times and as many permutations I completed trying to make that “command prompt” work I was sure I had to have the “prompt” line right at least once. As stated in my last post, I finally zipped up Camellia Creek’s five files and uploaded that to the Kindle Direct Publishing’s digital text platform (DTP). Hardly mastery of KindleGen and most unsatisfactory for one who considers herself a serious publisher, albeit of only my own stuff. Misfortune offered me an opportunity to redeem myself. 

While uploading Camellia Creek to the DTP, I noticed on my publishing page that Epico Bayou (which had gone “live” over a year before when I uploaded the MobiPocket-created .prc), for some inexplicable reason, had fallen into a “draft” status. Like my recent experience with Camellia Creek, I could not get that original MobiPocket Creator-crafted .prc to re-upload and when I zipped up Epico Bayou, replicating what I’d done with Camellia Creek, Epico Bayou’s navigational table of contents (the .ncx file) didn’t work. I wanted to sit down and squall. Instead, I resolved to master KindleGen and at the same time fix Epico Bayou’s shortcoming.

My effort to build Epico Bayou using the KindleGen “command prompt” mirrored that of Camellia Creek two weeks earlier. Nothing I did worked. The “command prompt” window couldn’t “find a file” (always the last one in the list—I know because I switched them around). I now know there should not have been a “list” of files, which brings me back on point. I didn’t know how to write a command prompt.

At the beginning and the end of that eBookPioneer blog referenced above, the author suggested the easiest thing to do was to forgo the “command prompt” evolution and upload the files, along with the KindleGen execute file, kindlegen.exe, in the Kindle Previewer. I’d seen this sentiment expressed by others on the Kindle Direct Publishing (KDP) forum.  So, I opened the Previewer.

Where? Where, when I open the Previewer, was I supposed to load the darn files? There was nothing that said “build book.” Nobody had explained how or where to drag and drop those files into the Previewer, and it took a little guessing for me to finally figure it out.

I clicked on “open kindle book,” primarily because there wasn’t much else to click on. What opened, of course, was the library listing the books that are already in my Previewer. I went one folder up: Local>Amazon>Kindle Previewer and it is that window into which I dragged my book file—that is the “Kindle Previewer window,” right? Clear as mud! Then I clicked my book file to open. Low and behold, the .html file and the .opf file appear in the folder. The others aren’t there.

Now, I already suspected from other vague comments in the forums that the .opf file was the key, so I clicked on it and, much to my amazement, a window opened up and said the Previewer was compiling a book. Sure enough, seconds later the window changed, said a book had been created and to view it, click here [not a live link]. I clicked and was taken to a window that showed me Epico Bayou as a .mobi book, and when I opened it—now in the Previewer—not only was my old, familiar Epico Bayou there, its .ncx worked.

I wasn’t completely out of the woods. Though I had Epico Bayou in the Kindle Previewer, I still had to find that file in my browser so I could upload it to Amazon’s DTP, and the address given in my browser showed that it was residing down a long link of folders, some of which were unfamiliar to me, so I couldn’t follow them back to find where the book was stored. That meant a search. I did find it, quickly as it turned out, in My Kindle Content folder. In one forum, a fellow stated he found his in My Publications. I have a My Publications file, too, but as I said, Epico Bayou.mobi was in My Kindle Content folder. Obviously, where a Previewer-created book resides is not set in stone. Just to see if the Previewer method would work a second time, I made Camellia Creek into a .mobi using the same methodology. It took seconds. Previewer stored that baby away in My Kindle Content, too.

Realizing the .opf file is key to building the book compelled me to try the “command prompt” again—hey, I’m slow, not stupid. This time, I put my five files (.html, .opf, .ncx, cover, and logo graphic) into one file and added the kindlegen.exe to it. Here’s the prompt I used: 

      C:\users\Charlsie>c:\KindleGen\kindlegen.exe C:\KindleGen\EBWord.opf  

I hit “enter” and the screen filled with line after line of data and at the end it said “book built successfully.” I blinked in astonishment, then looked over at the open window displaying my book’s files. Sure as shootin’ there sat EpicoBayou.mobi in the folder with a little blue book symbol on its left. I opened it in Previewer, and its .ncx worked, too. 

Now, I think the “command prompt” window is simplest. 

Okay, let’s go through both methods step by step, but before I start, I’m making the assumption you are building an ebook for uploading to the Kindle Direct Publishing’s DTP and have created the required files needed to work on all Kindle devices—that is your goal, right? If you have only a book file, you probably won’t encounter the problems I did, anyway.

The files I’m referring to are your book itself (mine is in .html format); your book’s .opf file; your toc.ncx file (this is a table of contents that makes navigation through the book easy for the reader and creates the “tick” marks at the bottom of the kindle screen so the reader knows where he is in the book); and all graphics saved as .gifs (Kindle wants .gifs, not jpgs). If you need further reference regarding creation of the ancillary files, see my old blogs dated 1 December 2011-3 February 2012. 

Previewer Method: 

1. Create your book files and put them together in one folder:

    a. All graphics, saved as .gifs

    b. The book itself (I do mine in .html)

    c. Your .opf file

    d. Your .ncx file 

2. Download your free KindleGen at: 


KindleGen is a .zip file. Unzip it and copy and paste the kindlegen.exe file to the book folder you made above. While you’re at it, make several copies of that .exe file and store ’em for future Kindle books. 

3. If the KindleGen Previewer didn’t come with the KindleGen download, find it here: 


4. Open Kindle Previewer. 

5. Go to “open kindle book” on homepage of Previewer.  

    a. You should now be in your library. 

    b. Go one folder up. The browser at the top of the window should read something to the effect: Local>Amazon>Kindle Previewer. No matter what comes before it, you want the window for the “Kindle Previewer”. 

6. Drag and drop/copy and paste your book folder into this screen of the Kindle Previewer. 

7. Click on your book to open it. You’ll see the .html (or whatever format you have your book in) and the .opf. 

8. Click on the .opf file. A window will open telling you Previewer is compiling the book. 

9. When the compilation is done (seconds), a window will come up and tell you the book has been created and to click here to review it. Go ahead, feast your eyes on your new baby. 

 10. Back in the book folder, you’ll see that another file has been created called book’s name converted.opf. That’s your book.

Command Prompt Method

1. Download KindleGen here: 


2. Make sure you have the Previewer and if not, download it from here: 


3. Go to Computer or My Computer by clicking the Start button at the bottom left of your computer screen (or you can use the icon on the Desktop). 

4. Amongst that list of program files and users, make a new folder and call it KindleGen. 

5. Return to your KindleGen download and open the folder (it’s zipped). 

6. You only need one file out of this folder—kindlegen.exe. 

7. Copy it, then go back to your KindleGen folder in your “Computer” folder and paste kindlegen.exe there. 

8. Find all your book files: .html, .epub, whatever you’ve called it; .opf; .ncx; graphics; and anything else you have associated with your book. Copy and paste each into the KindleGen folder with the kindlegen.exe.

9. Go to All Programs/Accessories and open Command Prompt 

 10. A black screen will appear with a starting line something to the effect of : 

        C:\Users\Charlsie>
                          ↑ This name is probably you or whoever owns the computer you’re on 

 11.  Now add the highlighted section: 

  C:\Users\Charlsie>C:\KindleGen\kindlegen.exe  C:\KindleGen\EBWord.opf
                                                substitute the name of your .opf file, of course ↑

 12. Hit enter and the book should build and will, within seconds, appear in your KindleGen folder as title of your book.mobi. 

 13. Click on it, and it will open in the Previewer

I chose to put my KindleGen folder in Computer because that’s where eBook Pioneers suggested I put it way back when I started this evolution, but you can put it wherever you want. And you should probably be more specific with the name of the KindleGen folder so you will one day be able to distinguish one book folder from another (i.e., KindleGenEpicoBayou, KindleGenCamelliaCreek, and so forth); just remember to type it as such in the “command prompt” line when you build the book.

No comments:

Post a Comment

I encourage you to leave comments. I'll reply to all questions within a week, and errors in the posts will be acknowledged in the comment area. Feel free to answer questions/clarify confusion I express in my posts. Disagree with my points if you believe there is need for disagreement, but keep in mind that all off-topic comments, disparaging comments, comments with more than one link, and comments that include profanity will be deleted.