I've released Mobi2IMP 9.4 now, which has minor bug fixes and some enhancements.
Just download, unzip and install the Mobi2IMP-9.4-Installer.zip attachment followed by the updated Mobi2IMP.exe dos executables in Mobi2IMP-9.4e.zip. Please read the EDIT at the bottom of this post for more information.
Mobi2IMP converts non-DRMed Mobipocket .PRC/.MOBI and PalmDOC .PDB files directly to .IMP formats (i.e. EBW1150 .imp, REB1200 .imp, REB1100 .rb and/or OEBFF .oeb/ETI .epub).
This project was created by Nick Rapallo and was inspired by PDFRead's .IMP creating module (ImpOutput) by Ashish Kulkarni and 'mobi2html' in Mobiperl by tompe on mobileread.com.
Changes in this release:- improved the removal of stray blank lines BEFORE a page-break that caused empty blank pages to be inserted into the ebook.
- By default, Mobi2IMP now pads images with white space to match the device's aspect ratio. It also now relocates links to images that pointed to between an illustration and caption as well as removes any blank lines there between. (zelda_pinwheel will appreciate this when re-converting HarryT's 'Austen' classics)
To avoid these fixes, two new switches are added to not fix images or image links between illustrations and captions. Choose '--noimagefix' to not pad/resize images to device's aspect ratio and '--noimagelinkfix' to leave image link locations "as is" and not remove blank lines before captions.
- minor code clean-up and more informative messages.
REQUIRED: You
must have the
eBook Publisher software previously installed to facilitate the conversions. Due to the new Windows GUI, you no longer need to use the dos/command prompt or perl script.
Also, batch conversion using 'prc2imp.bat' can be done on Windows for all .PRC/.MOBI/.PDB in a folder. This will allow those with many mobipocket .prc/.mobi/.pdb files to migrate them to their ebookwise 1150 easily. For recursive batch processing, see
post#11 below
Then all you have to do is put mobi2imp.exe in your path (or current directory), your 'prc2imp.bat' into the current directory containing your .prc, and then double-click 'prc2imp.bat' (just ensure you don't have too many .prc as ALL of them will be converted!)
After downloading and unzipping the Windows installer below (
Mobi2IMP-9.4-Installer.zip), install the Mobi2IMP GUI to any drive location. After this Windows installation, in samples folder of the Mobi2IMP home directory (i.e. C:\Program Files\Mobi2IMP), a sample batch file can be executed to produce the sample .IMP ebooks along with the .opf project file used internally.
With mobi2imp, just beware that you're stuck with any inconsistencies (if any) introduced by the .prc/.mobi original when converting over. However, you can load the resulting .opf file into eBook Publisher and can further edit/tweak/build it, if necessary.
For a MINI-TUTORIAL, check here.
For the Mobi2IMP Wiki, check here.
For the Mobi2IMP Development Hub, check here.
Enjoy!
-Nick
Previous changes...
Code:
This all started out at post
#197 in the Mobiperl thread and has evolved into a functional perl script and Windows GUI executable.
version 2 - Now 'Category Author Title' are optional and don't need to be provided (if the mobipocket ebook was 'well' composed).
version 3 - Now more forgiving of poorly constructed anchors (seen in
feedbooks.com .prc's) and will insert the '<a name' tag as long as the 'filepos' points to the start of a tag i.e. "<". This will help retain most, if not, all hyperlinks!
version 4 - Things that changed:
- Now better warns that eBook Publisher must be installed first.
- now takes switches '
--1200' and '
--1100' to allow for the simultaneous creation of the REB 1200 and REB 1100 versions along with the EBW 1150 .IMP version.
- conversly, if the switch '
--1150' is specified, then the EBW 1150 .IMP version is NOT created.
version 5 - Things that are allowed now:
- now allows you to change the text one font size larger ('medium') and one font size smaller (back to 'x-small') by using '
--largerfont' and '
--smallerfont' respectively.
- per JSWolf's request, you can now change margins from the default (2%) to '
--nomargins' (0%), '
--largemargins' (5%) and even '
--hugemargins' (8%)
- you can change the default text-align from justify to '
--nojustify' (i.e. left aligned).
- further to Kovidgoyal's recent 'mobi2oeb' post, now can output in OEBFF (.oeb) output with '
--oeb'.
As a result, the output can be any and all at once of: '--1150' .IMP, '--1200' .IMP, '--1100' .rb and '--oeb' OEBFF!
version 6 - Changes:
- per DaleDe's request, you can now change margins from the default (2%) to '
--tinymargins' (2px).
- no longer requires external program (nconvert.exe); all image 'fixing' done internally by GD.pm (
thanks to tompe for this suggestion)!
version 7 - Changes:
- per DaleDe's suggestion, you can now add small indent with '
--indent'.
- per JSWolf's request, you can now eliminate (blank line) paragraph separation with '
--nopara' (may also need to indent para with '--indent').
- per DaleDe's suggestion, you can now get more info with '
--verbose' or '
--debug'.
-
first attempt at a 'readme.txt' - you get this also by executing 'mobi2imp' without any paramenters.
version 8 - Changes:
- can now override default .IMP naming of 'Author - Title'.ext, by using '
--out MYIMPBOOKNAME' to specify .IMP filename produced (omit .ext)
- BUGFIX: now strip <body> tag of any BD/mobi specific in-line styles before start 'fixing' things.
version 9 - Changes:
- can now handle (text) .pdb files properly i.e. PalmDOC 'TEXt'/'REAd' type
- now makes the BookDesigner notice at the end 'small print' by default :thumbsup:
- can make that BD notice 'big print' with '
--BDbig'
(case sensitive)
- can make that BD notice start on a newpage using '
--BDnewpage' :2thumbsup
- can even remove that BD notice at the end with '
--BDremove' :eek:
- to add flare, can use '
--bgcolor #FF80FF' to set background color for every page
- BUGFIX: Only when using '--nopara' option, some <br />'s get ignored so another <br /> is added; if this creates issues, then '
--noBRfix' will not add the second <br />.
version 9.1 - Changes:
- installs a Windows GUI
ala PDFRead that can be used to convert files instead of using dos/perl. It even
remembers 'options' last chosen!
- removed 'ExplodeDir' as a required parameter and uses, as the default temp/explode DIR, the filename without extension (can be overridden).
- added ability to optionally add a (default) 'cover' image to every conversion from .mobi to .imp based on the embedded cover in the source file.
- implemented optional running headers (ala GEBLibraian) with two variants: one with the traditional 'Title Author' line followed by a <hr>; another with the header line only in color specified by the user.
- added better documentation and even a mini-tutorial
version 9.2 - Changes:
- can now be installed on a different drive than your C: drive; just keep the same subdirectory structure for the GUI options file to be loaded properly.
- removed
'--tinymargins',
'--largemargins' and
'--hugemargins' and replaced with
'--LRmargins LR' where
LR can be inputted by the user (usually 2px, 5%, or 8%).
- corrected GUI to replace 'no indent' option with proper
'use indent' as default is to NOT use any indent. Also moved things around a bit to make room for future options.
- updated the 'Mobiperl' part of the code to implement recent improvements tompe put into 'mobi2mobi' and 'mobils' (like longtitle!).
-
FAQ: If Mobi2IMP is run with no parameters, then the help screen now warns that
'If resulting .IMP is wrong version in viewer, just re-install eBook Publisher!'
-
FIX: stripped from
'Title' and
'Author' any characters that are invalid for filenames.
-
FIX: removed stray blank lines BEFORE a page-break that caused empty blank pages to be inserted into the ebook.
-
FIX: fixed aspect ratio of images that caused images to 'bleed' into bottom and become 'chopped off' for either the 1150 and/or 1200 .IMP versions. Just padded sides of images with 'white' background until aspect ratio no longer causes a problem with eBook Publisher's weak handling of image re-sizing!
- better verbose/debug info; information is good!
version 9.3 - Changes:
- added UTF-8 encoding support recently implemented in Mobiperl by tompe.
- changed 'cover_nr.html' to replace L/R margin '2em' with '2px' to allow for bigger images.
- Allowed 'aspect ratio' used to fix image resizing issue to be tied to device output. For 1150 or 1100 output, an aspect ratio of 0.72 is used; whereas if 1200 is selected for output, it will be overridden by an aspect ratio of 0.79 (even for other output options within the same conversion).
It will be better to not simultaneously convert a file, but rather do the 1200 first, then the 1150 or others.
Pending improvements (available now in below Mobi2IMP 9.4e dos version .zip)
- NEW: Now converts Mobipocket-specific tags like <div height="0em"> and <div width="0em"> to
<div style="margin-top:0em"> and <div style="text-indent:0em">. Works for all tags like "<div " but "<img ".
Thanks to Nate the great for the inspiration!
- FIX: Allows proper <p>, <div>, <ul>, <li> closing tags now. Thanks to Jellby for the tip!
- FIX: Re-tweaked the image resizing to better allow one line of text below the image i.e. a "caption".
- FIX: Now properly uses lowercase tags instead of depreciated UPPERCASE tags.
- FIX: Tweaked the image resizing to allow one line of text below the image i.e. a "caption".
- FIX: Allows proper handling of null (0) content EXTH data.
- NEW: Now implemented extradata MobiPerl processing for multibyteoverlap coded ebooks.
- FIX: Now helps retain ill-formed links. When trying to find a "home" for a filepos link, Mobi2IMP will be aggressive, despite bad placement, and scan forward up to 256 chars away from specified filepos location.
- NEW: Now better handles image (aspect-ratio) resizing and allows for the simultaneous sequential conversion to EBW1150 .imp and REB1200 .imp.
- NEW: Now can build a (non-Sony) ETI .epub when the OEBFF (.oeb) GUI option is selected. Will cause the simultaneous creation of the .oeb ebook, but that .oeb can be deleted if the 'debug info' is selected (bug: not yet working).
- NEW: Allows the proper (functional) conversion of Feedbooks.com news feeds despite some quirks. Now can download RSS/news feeds in mobipocket format and convert them directly into .imp.
- NEW: Allows the proper (functional) conversion of Calibre news feeds despite some quirks. Now can download RSS/news feeds in mobipocket format and convert them directly into .imp.
- FIX: Now strip/blank out nulls and characters below ASCII 32, except chars 9 to 15. Also, remap some such chars to their HTML code equivalents. Now allows the converion of the MobileRead.com Mobipocket Download Guide as well as the Feedbooks.com Kindle Download guide into .imp.
- NEW: Now prints a summary of the .imp ebook/metadata info when done.
- FIX: Now properly uses the output directory to store results in a different directory than the input. Thanks to Elsi for discovering this.
- FIX: Now properly manipulates BookDesigner notice at end "as advertised".
TO DO:
-
EDIT: I will no longer change the GUI installer for minor bug fixes that do not change to GUI options screen. Instead, I will update only the Mobi2IMP.exe in the 'Mobi2IMP' directory. Unzip the highest version number followed by a letter below, if any, into the 'Mobi2IMP' home directory overwriting the old files/.exe in that directory as well as the 'bin', 'doc' and 'src' subdirectories. At the next release, these files will be deleted!
Previous version downloads: 54