02-20-2008, 12:59 PM | #16 |
Resident Curmudgeon
Posts: 76,511
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I've figured out what is going on and why the bug exists.
the blank lines are <br /> and they are not being picked up and converted to a blank line. If you fix that, you'll be good to go. I looked at the expanded HTML and yes, it had <br /> for the blank lines. So no, I do not need to test version 7. Just get a fixed version 8 or a version 9. |
02-20-2008, 02:00 PM | #17 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
I have a work-around fix that could be inserted after line 289 in 'mobi2imp.pl' (just after the <body> tag substitution): Code:
if (defined $opt_nopara) { $html =~ s/<br([^>])*><div/<BR \/><BR \/><div/g; #force <br /> to work better in ebook Publisher } I used this 'fix' to produce the attached .IMP version of 'The Heretic.prc' Is this better? -Nick p.s. the links to Chapter 9, Chapter 10 and Chapter 22 don't get fixed by the mobi code in 'mobi2imp' so you may want to check the original .prc to see if it is working properly. Also, in Chapter 40, I noticed an extra line para break ('<br /><br /><div') where the original .prc has a '<br /><div' which probably shouldn't be there Last edited by nrapallo; 02-21-2008 at 06:31 PM. Reason: see JSWolf's .IMP version of 'The Heretic.prc' |
|
Advert | |
|
02-20-2008, 03:38 PM | #18 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
I've tried it on some files with no unexpected results, so maybe it will work. By the way, can you just put the below .bat file in a directory full of .prc/.mobi that you want to convert and check for any other problems? Just make sure this new 'mobi2imp.exe' is in your 'path'. Have fun! Last edited by nrapallo; 02-21-2008 at 06:33 PM. Reason: version 9 now implements this; but can disable it too |
|
02-20-2008, 05:09 PM | #19 |
Resident Curmudgeon
Posts: 76,511
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I've tried your new version 8b and it seems to work. Check out the new version of The Heretic to see. I would like to know what you think of it on an actual EB1150.
|
02-22-2008, 12:30 AM | #20 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
VERSION 9 - Changes: - mobi2imp.exe (version 9) - windows executable - can now handle (text) .pdb files properly i.e. ereader 'TEXt'/'REAd' type - now makes the BookDesigner notice at the end 'small print' by default - can make that BD notice 'big print' with '--BDbig' (case sensitive) - can make that BD notice start on a newpage using '--BDnewpage' - can even remove that BD notice at the end with '--BDremove' - 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 />. The 'mobi2imp' program is now very stable and mature enough to be used effectively in re-conversion efforts using a .prc copy for the previously BD made .IMP. Enjoy! |
|
Advert | |
|
02-24-2008, 11:29 PM | #21 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Mini-tutorial for Mobi2IMP
Quote:
After installing Mobi2IMP 9.4 using the Windows installer, you can use the new Windows GUI instead of using the dos/command prompt or perl script. REQUIRED: You must have the eBook Publisher software previously installed to facilitate the conversions. The mobi2imp.exe can be run from within an already opened Dos box i.e. command prompt and then only needs one argument "My Source.prc". If there are any spaces, then you need to surround them with quotes. Don't double-click the .exe directly nor the .pl; it is best run from within a batch file (see below) You can also specify 'Category' (like Fiction) 'Author' or 'Title'. Try this: Code:
c:\> mobi2imp.exe --verbose "My Source.prc" Fiction Code:
@echo off rem Convert .mobi/.prc to .imp process devised by Nick Rapallo (Jan. 2008) rem ============================================= rem Start the conversion of all .prc files in this directory to .imp format rem For GEB 1150/EBW 1150 only output; add switch '--1200' for REB 1200 .IMP for %%i in (*.prc) do mobi2imp.exe --verbose "%%i" "%%~ni" for %%i in (*.mobi) do mobi2imp.exe --verbose "%%i" "%%~ni" for %%i in (*.pdb) do mobi2imp.exe --verbose "%%i" "%%~ni" rem That's it! We are now finished the conversion of all .prc files echo WoW! All done. pause 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!) Also, options like 'margins' and 'text-justification' can be better controlled in the mobi2imp via command-line '--options'. Popular options are: '--out IMPFILENAME' set .IMP filename to use (overrides default naming) These options (sometimes called switches) go just after mobi2imp.exe and ALWAYS start with two dashes (i.e. '--verbose'). Just forget about getting the .pl and ActiveState Perl setup working. With the .exe, you don't even need ActiveState Perl!'--smallerfont' use 'x-small' font size for body text like pre-fix BD not default 'small' '--nojustify' no full justification (i.e. left-aligned) not 'justify' '--nopara' use no paragraph separation not 'blank line' (1em) separation '--indent' use small (1em) indent instead of no (0em) indent With mobi2imp, just beware that you're stuck with any inconsistencies (if any) introduced by the .prc/.mobi original when converting over. However, 'mobi2imp' also creates a .opf that can be loaded into eBook Publisher and from there you can further edit/build it. All in all, I like the output of mobi2imp. I have been converting Madam Broshkina's .prc posts (with her permission) using mobi2imp.exe. For one I did recently, I used this command-line (in a batch file): Code:
mobi2imp.exe --1200 "Authors Various_The Worlds Greatest Books Volume V.prc" "AUTHOR5" Fiction "Authors, Various" "The Worlds Greatest Books Vol 5" p.s. Thanks to DaleDe there is now a wiki entry for mobi2imp here Last edited by nrapallo; 04-15-2008 at 06:26 PM. Reason: revised due to new Mobi2IMP GUI 9.4! |
|
03-24-2008, 10:59 AM | #22 |
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
I have used ebook Publisher (v2.2.3) for many years to create .imp files from my own XHTML code.
I could not get Mobi2Imp working at first because it could not find Publisher but after I updated it to v2.2.5 all worked well. I was surprised that Publisher had been updated because I understood it was not being supported any more. Mobi2Imp is a great and useful tool. I have only one gripe - why does it replace a closing </p> with <div height="0em"></div> <div height="0em"></div>? This makes for a larger than necessary file and also it is difficult to edit the html code to correct it. |
03-24-2008, 11:33 AM | #23 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
The </p> endings are being stripped/altered BEFORE the .prc is used by Mobi2IMP. I'm not sure if it is tompe's Mobiperl code or the use of BookDesigner. I think BookDesigner may be the culprit of the '<div height="0em"></div> <div height="0em"></div>' construct. Either way it's not Mobi2IMP's doing. BTW, if you can read perl, check the source, mobi2imp.pl, for items replaced by Mobi2IMP. I've used eBook Publisher for years and have come to respect its power and usefulness. It also doubles as great "validator" of HTML v3.2 code since it gives detailed error messages and points to the error in the source file. Sure, it has a few shortcomings (image re-sizing fails to honour bottom margin; missing fraction HTML numeric codes; ...) but it has seen some improvements over the years (margin indents work better now; new default 'small' font size for eBookwise 1150; ...). If you have any more specific Mobi2IMP questions/comments, please be sure to post in the thread Mobi2IMP 9.4 with new Windows GUI released! Here, we discuss the current (and future) version of Mobi2IMP. p.s. drool... How do you like the iLiad vs. the eBookwise 1150? Last edited by nrapallo; 10-18-2008 at 08:33 AM. |
|
03-24-2008, 04:21 PM | #24 | |||
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
Quote:
Quote:
Quote:
I prefer my Cybook Gen 3 to the iLiad because of its longer lasting battery and faster boot-up time. But the eBookwise 1150 beats them all in terms of ergonomics and ease of use. This would be my ideal if it had an e-ink screen. |
|||
03-24-2008, 04:52 PM | #25 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Just issue the command: Code:
mobi2html "Your.prc" TempDir Code:
mobi2html --rawhtml "Your.prc" Temp >My.html Hope this helps! |
|
03-24-2008, 06:37 PM | #26 |
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
Deleted post
Last edited by Moonraker; 03-24-2008 at 07:52 PM. |
03-24-2008, 07:01 PM | #27 | ||
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Quote:
|
||
03-24-2008, 07:53 PM | #28 |
Addict
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
|
Sorry for my previous post - I had missed the my.html file thinking it would be in another folder. I have retested the files and the following is my findings:
Thank you for the link and for the instructions: This is all very interesting to me because I have never before seen the html code behind a prc file. For the test I used the same prc file but gave it two different names. First file test (mobi2html "Your.prc" TempDir): Size: 1152 KB 250 occurrences appeared throught the document. These would have to be removed. i.e. adhering changed to adhering </p> stripped and replaced by <div height="0em"></div> <div height="0em"></div> &8220; changed to “ &8221; changed to ” &8217; changed to ’ &8212; changed to — Headings - i.e. <h4>Chapter 10</h4> Changed to = <h4 align="center"><font size="+1"><b>Chapter 10</b></font></h4> <b></b> added to headings but where <strong></strong> were in the original file they have been left unchanged. <br style="page-break-after:always" /> inserted at end of file. Second file test (mobi2html --rawhtml "Your.prc" Temp >My.html) Size: 1155 KB All numeric code unchanged. <b></b> Added to Headings but <strong></strong> in original file left unchanged. <font size="+1"> added to Headings </p> left unchanged but <div height="0em"></div> <div height="0em"></div> added between paragraphs. This seems superfluous to me. <mbpagebreak/> added to end of file. When I put the file through Tidy.exe I got 8833 warnings that <div> attribute "height" has invalid value "0em" NOTE: # omitted from numeric codes to get this posted. Last edited by Moonraker; 03-24-2008 at 08:00 PM. |
03-24-2008, 09:01 PM | #29 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Code:
<p>Html documents with this entity &# 20; bomb! No output produced by eBook Publisher v2.2.5</p> I think we can conclude that the Mobiperl code strips the </p> and just leaves behind the Mobipocket empty <div>'s. I have seen this behaviour with the .pdb to .imp routine in Mobi2IMP. BTW, you can take a PalmDOC .pdb (TEXt/REAd) document and have Mobi2IMP create a .imp version. |
|
03-24-2008, 11:10 PM | #30 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to produce epubs for Sony ereader | drmaxx | ePub | 1 | 03-15-2010 11:10 PM |
Anyone use Calibre to produce ebooks from HTML? | AlexBell | Workshop | 10 | 07-03-2009 08:15 AM |
Imp scripts and wine linux related | derrell | Fictionwise eBookwise | 12 | 10-31-2008 05:53 PM |
Perl only access to imp file info | derrell | IMP | 5 | 08-29-2008 11:38 AM |
Can BookDesigner produce an ebook that looks exactly like those from Connect? | Dr. Drib | Sony Reader | 4 | 03-30-2007 09:32 PM |