Home Forums DITA and XMetaL Discussion .mobi output – is it possible? Reply To: .mobi output – is it possible?

Derek Read

Reply to: .mobi output – is it possible?

One more oddity with Mobipocket Creator (warning).

If you drag and drop files onto the “Publication Files” window it accepts JPG files but doesn't accept PNG files (and possibly others). In order to get PNG files to show in my ebook (and stop errors from showing up in the build log) I had to manually copy them into the project folder created by this tool. No additional settings seemed to be necessary, the build process just seems to bundle them into the *.prc file as long as they are there.

I have not tested all file types, just HTML, JPG and PNG, so this could possibly affect other image formats. Presumably GIF are OK?

My version of Mobipocket Creator is 4.2 build 41 (and was described as “beta” during download).

In my testing this process seems to be the cleanest:

1. Don't use the Mobipocket Creator “Import from Existing file” feature, instead use “Create New Publication” > “Blank Publication”. It is faster and cleaner.
 1a. Give the project a name. Probably the same name as the title of your map (copy and paste from there).
 1b. Optionally, change the folder path.
 1c. Optionally, set the language (no time to become an expert on this but I'm sure this information is available somewhere).
 1d. Change the encoding to UTF-8 (as the DITA OT generates UTF-8 encoded HTML this seems to be desirable to me).
 1e. Click “Create >” button.

2. Drag and drop the HTML file created using the deliverable “Single HTML file as Input for Mobipocket Creator” discussed in my ealier post. The file will be copied into the publication folder (see 1b above + publication name) by Mobipocket.

3. Don't drag and drop any images onto the Mobipocket GUI. It might not pick up some file types (PNG at least) causing some files to be copied to the publication folder but not others (becomes messy). Instead, just open the folder from step 2 using Windows Explorer and copy and paste all your image files from those created by “Single HTML file as Input for Mobipocket Creator” into the publication folder.

4. Set any other settings you need to set for Mobipocket. This includes getting it to create its version of the TOC maybe (although it doesn't seem to do a better job than what our Single HTML output already does, so I'd skip that). Also, just looking at the “Metadata” section you might need to do some serious reading to get this perfect if you plan to publish the ebook on a commercial site. *

5. Tell Mobipocket to “Build”.

* This is one reason I find it unlikely that anyone would try to create a plug-in for the DITA OT that does all this. There are so many options here and this tool already lets you set them with a nice GUI (so why recreate it). This is similar to CHM in a way. In some cases what the DITA OT generates is OK, but in many cases people will still want to open the CHM project files, tweak them using HTML Help Workshop and rebuild from those tweaked files.