eBook Generator

Download file: 

One of the best features of RoboHelp 9 is the ePub creation. When you are on RoboHelp 8, ePub may look out of reach. Adobe kindly provided an ePub creation script for RoboHelp 8, but that script produces invalid output and it lacks a user interface. Also, I own a Kindle and that means that I can't put the ePubs directly on my eReader. Manually converting the ePub files using Calibre every time is a tedious job.

The following script gives you eBook creation in RoboHelp 8 and above. It contains both ePub and Kindle (.mobi) creation. This script is based on the default RoboHelp 9 ePub generator script.

If you want to know more about eBooks, the ePub format and how they work in RoboHelp, read the article Creating ebooks using RoboHelp 9 by Neil Perlin.

Current version: 05-08-2011

Note: This scipt is provided as-is, without warranty of any kind.

Setting up

  1. Download the eBook generator script.
  2. Unzip the file and import the file eBookGenerator.jsx from the root of the zip into RoboHelp.
  3. Download and install 7-Zip. (You can use the standalone version or the installable version.)
  4. If you want to create output for Kindle:
    1. Download KindleGen.
    2. Extract the KingleGen executable to the directory of your choice. The other files in the download are not needed.
  5. If you use RoboHelp 8: Download and install LibIconv for Windows.

Using the script

  1. Open your project and create an XML layout. Choose to output to XHTML.
  2. Run the script.
  3. On the tab Main, the setting Check created TOC for for missing references and illegal characters is active by default. Leaving this option active will check the TOC before the ePub is compiled to make sure there are no dead links. I advise you to keep this option enabled.
  4. On the tab Main, choose which formats you want to create: ePub, Kindle (.mobi) or both.
  5. On the tab 7-Zip Location, add the path to the 7-Zip executable.
  6. If you want to output to Kindle:
    1. On the tab Kindle options, add the path to the KindleGen executable.
    2. On the tab Kindle options, choose a compression setting for your Kindle output. The compression determines the time it takes to create the Kindle output.
    3. On the tab Kindle options, choose if you want the script to create a HTML TOC for the Kindle output. If you do not choose this option, the Kindle output will not have a TOC that the user can access.
  7. If you use RoboHelp 8: On the tab LibIconv Location, add the path to the LibIconv executable.
    Click Generate to save your settings and generate the eBook.
 
Note: This script saves settings in the 'All users' folder on your computer to allow multiple users to use the same settings. If your settings are not saved, the Windows UAC (User Account Control) may be preventing the script from writing the file. If this happens, try running RoboHelp as an administrator or disable UAC. Disclaimer: Disable UAC at your own risk. I am not liable for any damage (direct or indirect) that may come from disabling UAC.
 

Note for RoboHelp 9

The script saves the output directory, SSL and metadata and the cover for each project individually. The other settings are saved for all pc users. By default, this script uses the same file as the RoboHelp 9 ePub generator to save the settings. This is by design: if you have already used the ePub generator, the script uses the existing settings.

If you run the ePub generator after the eBook generator script, your Kindle conversion settings will be lost. If you do not want this, you can change the settings file for this script:

  1. Open the script and search for RH_EPUB.xml.
  2. Change the name RH_EPUB.xml to something else, such as: RH_EBOOK.xml.

After you have done this, you need to set all settings again. Your settings are no longer shared between both scripts.

Kindle conversion notes

The Kindle has limited support for HTML and CSS. If you want to create Kindle output, please note the following:

  • The Kindle has very limited support for HTML and CSS. For all details, please see the Amazon Kindle Publishing Guidelines.
  • Try to avoid tables. Only very simple tables are rendered correctly on the Kindle. If you need tables that are more complex, convert them into an image. For more information, see the Amazon Kindle Publishing Guidelines.
  • Do not use paragraph tags inside lists. The Kindle does not render this correctly.
  • The script creates a Kindle conversion log (RoboHelpKindle.log). If your output is incorrect or if the .mobi is not created at all, please check the log.
  • You can check the Kindle output by using a Kindle (duh), by using the free Kindle for PC, by using the free Kindle Previewer or by using any eReader or software that can handle .mobi files.
  • Additional conversion tips in the Scriptorium blog: http://www.scriptorium.com/2011/02/from-epub-to-kindle-technical-writing-101-now-has-a-kindle-edition/
  • The script provides default styling for the created HTML toc. You cannot change this styling in the UI. If you want to change the appearance of the HTML TOC, change te css in the variables tocKindleTitleStyle and tocKindleIndent.
  • The script adds whitespace for the highest level of TOC items in the Kindle HTML TOC. You can amend the amount of whitespcae by changing the css in the variable tocKindleH1TopMargin.

Known issues

There are no know issues in the current version. If you encounter a problem, please contact me.

Revision history

eBook script revision history
Version Change
05-08-2011
  • Fixed a bug for RoboHelp 8 that could delete files from your user profile when you try to generate with your SSL not set to XHTML output.
  • Fixed some small bugs that could prevent eBook creation on windows XP.
  • Improved ePub conversion (fallback when Kindle output could not be generated).
02-08-2011
  • Fixed a bug that required you to always create ePub output when you wanted to create Kindle output.
  • Added whitespace for the highest level of TOC items in the Kindle HTML TOC.
13-06-2011
  • Added cover page.
  • Major performance improvement for TOC checking mechanism. (20% to 50% faster).
  • Many minor fixes.
20-05-2011
  • Fixed bug that invalidated spine. This bug broke Kindle generation on some projects.
  • Added Option to convert ePub when Kindle generation failed.
  • Stopped copy of XML SSL control files.
19-05-2011
  • Fixed some typos and made small changes in the GUI.
05-05-2011
  • Added improvements from RH 9.0.1 patch ePub script.
  • Remove external URL's from TOC when checking TOC for consistency.
16-04-2011
  • Modified Kindle Creation method: Generate Kindle output from .opf and do not convert ePub.
  • Added option to open Kindle in default application after creation.
  • Generate Kindle HTML TOC.
12-04-2011
  • If an anchor in the TOC does not exist in the file, the link is removed from the TOC.
  • If an anchor contains special characters, the special characters are replaced in both the TOC and the file. Done to support Adobe Digital Editions.
  • Small UI modifications.
31-03-2011
  • Fixed “TOC not found” problem when output file name is not the same as project title.
16-02-2011
  • Initial version: Added RH8 support and Kindle conversion support.
 

Tags: