Mobileread
Mobi2IMP 9.4 with new Windows GUI & UTF-8
#1  nrapallo 03-22-2008, 02:22 AM
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:
REQUIRED: You must have the eBook Publisher@Wiki » 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
Mobi2IMP_GUI_9.1.jpg Mobi2IMP_GUI_9.2.jpg Mobi2IMP_GUI_9.3.jpg Mobi2IMP_GUI_9.4.jpg 
[zip] Mobi2IMP-9.4-Installer.zip (4.03 MB, 2765 views)
[pl] mobi2imp.pl (38.7 KB, 1335 views)
[zip] Mobi2IMP-9.4e.zip (1.71 MB, 1869 views)
Reply 

#2  nrapallo 03-22-2008, 02:23 AM
Reserved for updated Tutorial and FAQ.

FAQ: If resulting .IMP is wrong version in viewer, just re-install eBook Publisher!
I see you have found the infamous bug that the 1150 .imp "thinks" its a 1200 .imp!!!

The solution to this is to re-install eBook Publisher software. Since you may also use BookDesigner or GEB LIbrarian (aka eBookwise Librarian), the various .dlls used get confused and need to be the eBook Publisher versions to use Mobi2IMP properly!
FAQ: GEB (eBookwise) Librarian fails to transfer/load the resulting .IMP!
The target output defaults to where the source input is. The resulting .IMPs are stored there. You can then manually copy the files (via Windows Explorer) over to your Bookshelf directory under the GEB Librarian home directory.

Word of caution, do not put the 1150 .imp in the same GEB Bookshelf as the 1200 .imp as GEB Librarian will get confused and the ebooks will not transfer properly. The reason seems to be that the ebooks were created at the same time and hence have the same Unique Edition ID (I think). Anyways, to be safe, just don't mix the resulting .IMPs in the same Bookshelf. Just segregate 1150 and 1200 .IMPs.
FAQ: I want to get Mobi2IMP, but don't want to use the Installer, for personal reasons!
The Mobi2IMP Dev Hub Download section will continue to host the current Mobi2IMP dos executable for each release version i.e. 'Mobi2IMP-9.4-dos.zip'. Also, the Dev Hub site has the latest Mobi2IMP noSamples and noInstaller version i.e. 'Mobi2IMP-9.4-noSamples-noInstaller.zip'. These versions are for more experienced users who know what the Installer does and thus can avoid using it.
Reply 

#3  DaleDe 03-22-2008, 01:10 PM
I just went to the development site and tried to download stuff. The pl file is forbidden (likely a permission problem) and the zip file is much smaller than the one above in the forum. As a matter of fact the exe file is the same size as the zip file above but the zip file on the development site uncompresses to only 2.6 meg. Seems to be a problem somewhere.

Dale
Reply 

#4  nrapallo 03-22-2008, 03:15 PM
Quote DaleDe
I just went to the development site and tried to download stuff. The pl file is forbidden (likely a permission problem) and the zip file is much smaller than the one above in the forum. As a matter of fact the exe file is the same size as the zip file above but the zip file on the development site uncompresses to only 2.6 meg. Seems to be a problem somewhere.

Dale
The Development Hub site is still a "work in progress..."; most things haven't fully been setup yet. I'm learning as I go. I'll see what could be wrong.

In the meantime, use the Windows Installer .zip in the first post above for now. It will 'install' the Mobi2IMP GUI 9.1 program (Mobi2IMP-gui.exe) along with dos executable (Mobi2IMP.exe), source (mobi2imp.pl), documentation and some samples.

By the way, the icon for Mobi2IMP that gets put in your Start Menu, can be later copied to the desktop for easier access.
EDIT: Ok this Dev Hub stuff is weird. The source mobi2imp.pl there is 'Forbidden' due to the .pl extension. I just replaced it with mobi2imp.pl.txt and it works now! Also, the 9 MB .exe at the Dev Hub site is the same file within the Windows Installer .zip above. The MobileRead forums do not allow .exe files to be attached (and for good reason!) so it shows up here as a .zip. The Mobi2IMP-exe.zip at the Dev Hub is just the dos executable not the GUI. Hope this helps explain things.
Reply 

#5  zelda_pinwheel 03-22-2008, 06:54 PM
yeah baby !! a gooey interface ! AND auto headers !! pretty soon, i won't need to tweak the code at all, anymore...
Reply 

#6  JSWolf 03-22-2008, 11:04 PM
Would it be possible to make a version 9.1 that has no GUI bloat that only uses the command prompt please? Before 9.1 i twas a nice simple program, easy to use without the need for an installer. Thanks!
Reply 

#7  nrapallo 03-22-2008, 11:17 PM
Quote JSWolf
Would it be possible to make a version 9.1 that has no GUI bloat that only uses the command prompt please? Before 9.1 i twas a nice simple program, easy to use without the need for an installer. Thanks!
Jon, the Dev Hub has the file Mobi2IMP-exe.zip which contains only the dos executable and no GUI frontend.

The GUI is not the bloat here; it is the samples that I included for novices to experiment with. The samples comprise almost 75% of the size of the installer. The GUI (Mobi2IMP-gui.exe) is very tight and efficient at only 61 KB compared to the dos executable (Mobi2IMP.exe) at 2.6 MB!

Try the Windows installer and then just delete its samples directory (I know YOU don't need any samples)! It is easy to use and just as powerful as the dos executable (except for batch processing of many files).
Reply 

#8  JSWolf 03-22-2008, 11:24 PM
Could we have a ZIP file with just the GUI, the non-GUI and the documentation. The GUI and the non-GUI really don't need to be installed in order to work.

I'll give the GUI a go and see how it works. And well done!
Reply 

#9  nrapallo 03-22-2008, 11:44 PM
Quote JSWolf
One problem with the windows installer is that it creates and adds a mess of files and directories I don't need or want Plus, it also puts it in a place that's not where I want it. And if I tell the installer to install it where I want, I have files I have to delete. Plus, I don't want an uninstall added to my system as I liked it being a nice simple no install version.

What I am saying is this needs to be like it used to be for those of us who aren't novices. What should happen in the ZIP file should contain all the files the installer installs without the installer. Then we can pick and choose what bits we want and were to put them.
Attached in the .zip is Mobi2IMP 9.1 without the installer and samples. Contains all important files and you can pick and choose which ones you want to keep. BTW, the GUI requires the default location of the dos executable/command file so for 'roll-your-own' types, it may not function.

Hope this helps.
[zip] Mobi2IMP-9.1-noGUI-noInstaller.zip (1.67 MB, 1258 views)
Reply 

#10  scruffy 03-23-2008, 09:41 AM
The only thing missing now is the option to do a recursive conversion, over a whole directory of files... the current batch file only does within a single folder/directory.

Give us the ability to mass convert via the GUI, since you are calling the commandline program with settings, just build the tree (given a directory) and call it for each matching file found (ie prc,mobi,pdb or all), same settings for each.
Reply 

  Next »  Last »  (1/12)
Today's Posts | Search this Thread | Login | Register