Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-19-2008, 05:20 PM   #1
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
bd2mobi - Application to convert Book Designer html0 to .mobi

I've written a perl script to convert .html0 files output by Book Designer to .mobi format for viewing on the Kindle or other .mobi devices. This should be useful to those of us who would like to (legally, of course) share our content with Kindle owners.

This will automatically generate the table of contents from the "Titles" in the original BD file.

I've attached a zip file with a compiled .exe file, and the Perl source for this file for anyone who'd like to contribute. You'll need to extract the .exe and download mobigen from Mobipocket (available at http://www.mobipocket.com/dev/)

The easiest way to use this is to create a shortcut to the .exe in your "Send To" folder. Then you can simply right click on any .html0 file and choose Send To>bd2mobi, and it will convert the file for you.

Let me know how it works for you!

p.s.- Thanks to HarryT for the excellent tutorial that I followed in creating this script.

version 2 now attached
This version now properly converts books with PNGs and GIFs in the source.
version 3 now attached
This version works properly with newer versions of mobigen and allows you to specify author, title and cover image.
Attached Files
File Type: zip bd2mobi_v2.zip (593.3 KB, 836 views)
File Type: zip bd2mobi_v3.zip (1.32 MB, 847 views)

Last edited by maggotb0y; 04-07-2008 at 10:24 PM.
maggotb0y is offline   Reply With Quote
Old 01-20-2008, 09:47 AM   #2
astra
The Introvert
astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.
 
astra's Avatar
 
Posts: 8,307
Karma: 1000077497
Join Date: Jan 2007
Location: United Kingdom
Device: Sony Reader PRS-650 & 505 & 500
Uhm. BD creates books for Kindle or CyBook Gen3 or Iliad without any additional tools. Why would you write another tool for the purpose?
astra is offline   Reply With Quote
Advert
Old 01-20-2008, 01:10 PM   #3
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
Quote:
Originally Posted by astra_lestat View Post
Uhm. BD creates books for Kindle or CyBook Gen3 or Iliad without any additional tools. Why would you write another tool for the purpose?
I'm not aware of a way to generate .mobi files from BD. There is a PRC (or perhaps PDB, don't have it in front of me at the moment) option, but that has never worked properly for me. Is that what you are referring to?

Doing research on the topic, I found HarryT's thread https://www.mobileread.com/forums/showthread.php?t=17914 and automated the process.
maggotb0y is offline   Reply With Quote
Old 01-20-2008, 02:31 PM   #4
astra
The Introvert
astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.
 
astra's Avatar
 
Posts: 8,307
Karma: 1000077497
Join Date: Jan 2007
Location: United Kingdom
Device: Sony Reader PRS-650 & 505 & 500
I was under the impression that BD can create mobi pocket books. Because Harry_T creates his books in BD. I was aware about TOC problems. I see why you wanted to automate the process.

Thanks.
astra is offline   Reply With Quote
Old 01-20-2008, 04:53 PM   #5
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by astra_lestat View Post
I was under the impression that BD can create mobi pocket books. Because Harry_T creates his books in BD. I was aware about TOC problems. I see why you wanted to automate the process.
It cannot create true MobiPocket books. It can pack HTML in a PalmDOC book that can be read by MobiPocket readers. But you need a true MobiPocket book if you want to have long titles and meta information like author. Also BD does not work on all platforms.

My MobiPerl contains opf2mobi which generated true MobiPocket books.
tompe is offline   Reply With Quote
Advert
Old 01-20-2008, 09:06 PM   #6
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
Quote:
Originally Posted by tompe View Post
My MobiPerl contains opf2mobi which generated true MobiPocket books.
You're welcome to grab this code for inclusion in mobiperl - it basically automatically creates a table of contents and an OPF directly from the HTML0 file, then calls mobigen to build the .mobi file, finally deleting the files it creates for the conversion.

Last edited by maggotb0y; 01-20-2008 at 09:30 PM.
maggotb0y is offline   Reply With Quote
Old 01-20-2008, 09:30 PM   #7
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by maggotb0y View Post
You're welcome to grab this code for inclusion in mobiperl - it basically automatically creates a table of contents and an OPF directly from the HTML0 file.
I put it on the list of possible things to do. I thought about it a couple of days ago but then decided that since HTML0 is a Windows specific format in the sence that the only tool that generates it runs only in Windows it was less interesting to do it.
tompe is offline   Reply With Quote
Old 01-20-2008, 10:41 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,542
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As motivation, html2lrf has a BD preprocessor
kovidgoyal is offline   Reply With Quote
Old 01-21-2008, 06:00 AM   #9
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by astra_lestat View Post
I was under the impression that BD can create mobi pocket books. Because Harry_T creates his books in BD. I was aware about TOC problems. I see why you wanted to automate the process.

Thanks.
The "MobiPocket" books that BD creates are very poor. They don't have any metadata, all text which should be centred comes out left-aligned, all pictures come out very small, the navigation links to the table of contents don't work - there are numerous problems.

It's a lot better to use BD as a book editor, but then to use the "Mobigen" or "MobiPocket Creator" tools to create a "proper" Mobipocket book. That's what I do now, and what this thread is all about.
HarryT is offline   Reply With Quote
Old 01-21-2008, 06:15 AM   #10
astra
The Introvert
astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.astra ought to be getting tired of karma fortunes by now.
 
astra's Avatar
 
Posts: 8,307
Karma: 1000077497
Join Date: Jan 2007
Location: United Kingdom
Device: Sony Reader PRS-650 & 505 & 500
Quote:
Originally Posted by HarryT View Post
The "MobiPocket" books that BD creates are very poor. They don't have any metadata, all text which should be centred comes out left-aligned, all pictures come out very small, the navigation links to the table of contents don't work - there are numerous problems.

It's a lot better to use BD as a book editor, but then to use the "Mobigen" or "MobiPocket Creator" tools to create a "proper" Mobipocket book. That's what I do now, and what this thread is all about.
I see.

WOW I am a little bit surprised and disappointed

When I was doing a research on iRex iLiad, I have asked a couple of times whether creating books for iRex iLiad would be more difficult or different than creating lrf files for Sony in BD and whether they would be of the same quality and as nice looking as lrf files. Besides pointing out to me that I will have to "manually" (use a certain command in BD) add TOC in the beginning of a book and that pics will be smaller, noone has mentioned all the problems that I hear now.
astra is offline   Reply With Quote
Old 01-21-2008, 10:04 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,404
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Does BD2Mobi create a proper table of contents and proper metadata?

Also, how does an eBook created using bd2mobi compare to doing it using Harry's tutorial?
JSWolf is offline   Reply With Quote
Old 01-21-2008, 10:20 AM   #12
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
Does the same thing as HarryT's tutorial

BD2Mobi reads the "titles" from the BD html0 file to generate the table of contents, and extracts the Author and Title of the book as well.

bd2mobi does exactly what HarryT's tutorial walks you through- it just automates it all. The only thing it does not automate is converting any non-jpeg images to jpeg. If it sees any gifs or pngs in the source, it will let you know that you need to fix that.

Last edited by maggotb0y; 01-21-2008 at 11:42 AM.
maggotb0y is offline   Reply With Quote
Old 01-21-2008, 10:25 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,404
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Sounds good. What version of Perl would I need for Windows in order to use your program?
JSWolf is offline   Reply With Quote
Old 01-21-2008, 11:03 AM   #14
RWood
Technogeezer
RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.RWood ought to be getting tired of karma fortunes by now.
 
RWood's Avatar
 
Posts: 7,233
Karma: 1601464
Join Date: Nov 2006
Location: Virginia, USA
Device: Sony PRS-500
vvv has stated that the BD output for mobi is several versions behind the current mobi level. It is one of the items on his enhancement list which itself has no publicly released milestone dates -- it may be released this week, it may be released in a year or more.

When we first released mobi books (with the PRC extension) there were only a few takers as the iLiad had just acquired the ability to read them. With the release of the Gen3 and now the Kindle the number of downloads for mobi books has grown. For most books the number of downloads for mobi is still below that of Sony but the gap is closing and for a few the mobi is format is more popular than the Sony.
RWood is offline   Reply With Quote
Old 01-21-2008, 11:40 AM   #15
maggotb0y
Connoisseur
maggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheesemaggotb0y can extract oil from cheese
 
Posts: 84
Karma: 1166
Join Date: Apr 2007
Location: New Jersey, Outside of Philadelphia
Device: Sony Reader
Quote:
Originally Posted by JSWolf View Post
Sounds good. What version of Perl would I need for Windows in order to use your program?
For the compiled version, you won't need Perl at all, just run the .exe.

If you want to modify the Perl script, you should be able to do this in just about any version of Perl- it isn't doing anything particularly fancy.
maggotb0y is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB to MOBI: "Failed: Convert book 1 of 1" Jillo Introduce Yourself 4 02-20-2010 07:49 PM
Mobi book won't convert to ePub HarryT Calibre 4 08-09-2009 12:20 PM
Using Book Designer to convert Lit to Lrf? Gibbo Sony Reader 11 07-22-2007 11:33 AM
Book Designer - I'm a Convert! HarryT Sony Reader 114 05-25-2007 11:15 PM
Handy Perl Script to convert HTML0 files to smartquotes maggotb0y Sony Reader 0 04-12-2007 12:49 PM


All times are GMT -4. The time now is 09:24 AM.


MobileRead.com is a privately owned, operated and funded community.