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 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 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 : 

                          ↑ 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 

 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.

Tuesday, July 16, 2013

New Adventures in Mobi Creation

No, not the whale, but the program that creates the digital book for Amazon’s Kindle (though at the moment I’m ready to put the great white whale’s last name to the whole evolution and refer to it by the crude vernacular). Since readers have their accounts set up and click a button to download their Kindle Book to their Kindle device all in a matter of seconds, an author needs her book in the Kindle Store. To get it there, she must create her masterpiece in .mobi format.

Getting my latest novel, Camellia Creek, a gothic mystery/suspense set against the backdrop of  Presidential Reconstruction at the end of the War for Southern Independence, into mobipocket, .azw format, took days, untold hours I wish I’d actually recorded so you could more clearly understand how absolutely anal I am. For those of you who have looked at my blog for “technical” advice, no matter how unintentionally spurious, you know that over a year ago I blogged extensively about my creation of the files required by MobiPocket Creator to build a mobi book. With those files—sitting in the folder for each individual book in the “My Publications” folder associated with MobiPocket Creator—I managed in 2011-2012 to upload my first four books and get them in the Amazon Kindle Store. Camellia Creek, thought I, will be a piece of cake.

Wrong. Oh, I created the files easily enough based on templates I’d created from my first four books—the .html version of my book, the .ncx file, a proper version of the .opf (MobiPocket Creator creates an .opf file automatically from whatever data one feeds it—if one feeds it no extra data, it creates it from the .html file itself and it always overrides whatever .opf file you place in the folder so you have to keep checking and cutting and pasting your good one over the one it makes. Suffice it to say, that evolution is time consuming and frustrating.). Then I added my only two graphics—the cover and my logo.

For four days I tried to get MobiPocket Creator to build my book. Now, I didn’t sit in front of my computer uploading and re-uploading the same files over and over during that time with the expectation of one time getting a winning result. That folks, is the definition of stupid. I’m just sorta stupid for sticking with it all that time. I’d make changes to the .opf and tried different renditions; I checked and rechecked all my files, my headers, my content, my “#$!%” html. I even removed MobiPocket Creator and reinstalled it—on both the computers I own with access to the internet. One thing I did discover was that every time I took the “failed” build and removed the .ncx from the mix, the book built. I knew the problem was with the .ncx or the .opf (which references the .ncx). I went to the online forums and studied and tried to replicate individual methods of inserting files into MobiPocket Creator and overcoming the Creator’s frustrating habit of messing up my .opf. At one point I created a .zip file of Camellia Creek’s files and attempted to insert that into the My Publications folder. That didn’t work either—works for epub, but not mobi. I kept the .zip file anyway.

Finally, on the fifth day, I removed the publisher version of  MobiPocket Creator and downloaded the “Home/Family” version. The MobiPocket Creator website said it was simpler to use. Personally, I didn’t see much difference from the “use” angle, but one thing that simple little sucker did when it, too, failed to build on my first try was point out one tiny error in the spelling in the “content src” for chapter seventy-four in my .ncx. I’d spelled “seventy” “seveenty”. I fixed it and Camellia Creek build on the next try, .opf, .ncx and all.

I don’t know that the misspelling caused all those wasted hours, not to mention stress, but the results rendered after its fixing indicates that was the problem. So why didn’t the “publisher” version point it out to me when the “simpleton’s” version was so quick to do so? Maybe the publisher’s version thinks publishers should know how to spell or are such thorough proof readers there is no way they’d let a screwball thing like three “e”s in seventy get by—this in a work of 79 chapters and an epilogue (Camellia Creek is twice the length of my previous books).

Oh, and now comes the really, really good part. I start uploading to Amazon—I get to Part 5 at the “Upload Your Book” window. The little pinwheel is purring, there’s a window there that says “uploading your book, this may take a few minutes” and wahlah—the KDP (Kindle Direct Publishing) platform rejects it. The window says, simply, that I used software other than that approved by Amazon. I’m confused—I sent them the .prc. KDP didn’t need to build my .prc. I SENT it one already done, darn it! And fifteen months earlier the KDP platform had accepted four of my .prc books built the same way—ok, this one was built with the “simpleton’s” Creator, but what the heck.

I go to the “formatting guide” offered in the rejection window. Sure enough, .prc’s aren’t listed. I go to the Amazon “techies”. “Yes they are,” the “techies” say. Two day’s later the “techies” have it figured out—I needed to use KindleGen to build my .prc, not MobiPocket Creator.

During that two-day interim, I went back to that “zipped” file I’d fortuitously saved during my nightmare of working with the publishers version of MobiPocket Creator and uploaded it at Part 5 of the Upload Your Book window. It uploaded fine. Camellia Creek is at the Kindle Store.

Next, my pathetic adventures using KindleGen.