Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > Bookeen

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2007, 04:14 PM   #1
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,113
Karma: 4315826
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
lit2mobi written in Perl working

I am working on a set of programs to convert to Mobipocket format. I have only worked on it a couple of days so the state of the code is alpha. I am a bit unsure if the mobi file is generated entirely correct but it seems to works on my Gen3.

If somebody would like to start using these program you need some familiarity with Perl and you need to know how to install modules from CPAN. I have tested on Linux and it should work on Mac and it might work with some small changes on Windows. Notice that the Perl programs writes the Mobifile so you do not have to run mobigen using wine or other similar programs. You have to have clit installed for lit2mobi to work.

If you do not want to install the program but would like to see the result you can send me a lit file and I will send you back the result so you could help by giving feedback on the result.

The programs are here:

http://www.ida.liu.se/~tompe/mobiperl/mobiperl-0.02.tar

You run it like:
Code:
    lit2mobi The_Railway_Children.lit

    lit2mobi --coverimage cover.jpg file.lit
Documentation available with
Code:
    perldoc html2mobi
since for now lit2html calls html2mobi.

I place the TOC in the beginning of the file also. I also search for a suitable cover image and use it automatically. I do not add a reference to the cover image and that seems to lead to that the book opens on the TOC page and if you go back one page you get the full cover image. If you have a reference you get two cover images instead.

Feedback (bug report, feature suggestions and so on) is very welcome
tompe is online now   Reply With Quote
Old 11-28-2007, 04:19 PM   #2
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: 26,135
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You should use the spine element of the OPF file if present to fix the order in which the HTML files are appended.
kovidgoyal is online now   Reply With Quote
Old 11-28-2007, 04:28 PM   #3
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,113
Karma: 4315826
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Quote:
Originally Posted by kovidgoyal View Post
You should use the spine element of the OPF file if present to fix the order in which the HTML files are appended.
I do that. But I duplicate the TOC and place a copy of it first since I have not gotten the guide stuff to work yet. It was an experiment but also it might be that on the Gen3 you want to have it that way. And yes since I only tested a couple of lit files and the TOC was always at the end I assumed that was the standard...
tompe is online now   Reply With Quote
Old 11-28-2007, 04:47 PM   #4
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 10,527
Karma: 3569525
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by tompe View Post
I do that. But I duplicate the TOC and place a copy of it first since I have not gotten the guide stuff to work yet. It was an experiment but also it might be that on the Gen3 you want to have it that way. And yes since I only tested a couple of lit files and the TOC was always at the end I assumed that was the standard...
Let me guess. Those LIT files were from Baen Books, right? They are the only ones I know that use that goofy placement.
Nate the great is offline   Reply With Quote
Old 11-28-2007, 04:49 PM   #5
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: 26,135
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The way the TOC is specified varies widely from lit file to lit file. Take a look at opf.py in libprs500 for the logic I use to figure out the TOC.

You might also find this page useful
http://www.idpf.org/oebps/oebps1.2/d...eb12-xhtml.htm

Last edited by kovidgoyal; 11-28-2007 at 04:52 PM.
kovidgoyal is online now   Reply With Quote
Old 11-28-2007, 05:06 PM   #6
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,113
Karma: 4315826
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Quote:
Originally Posted by Nate the great View Post
Let me guess. Those LIT files were from Baen Books, right? They are the only ones I know that use that goofy placement.
Well I think it is the right placement for devices were the TOC-button works fast. The Mobipoacket demo book also had the TOC at the end. But I will look at more test cases.
tompe is online now   Reply With Quote
Old 01-19-2008, 12:55 PM   #7
lovebeta
Groupie
lovebeta has a complete set of Star Wars action figures.lovebeta has a complete set of Star Wars action figures.lovebeta has a complete set of Star Wars action figures.lovebeta has a complete set of Star Wars action figures.lovebeta has a complete set of Star Wars action figures.
 
Posts: 176
Karma: 406
Join Date: Jan 2008
Device: Amazon Kindle 2, Amazon Kindle, Sony PRS-505
Thanks pal, it works great! I am wondering if you could add a batch process mode? It would be even better if it could recursively go through all sub-directory.

Thanks again.
lovebeta is offline   Reply With Quote
Old 01-19-2008, 01:06 PM   #8
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,113
Karma: 4315826
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Quote:
Originally Posted by lovebeta View Post
Thanks pal, it works great! I am wondering if you could add a batch process mode? It would be even better if it could recursively go through all sub-directory.
Well, maybe. I put it on my list of possible things to do. It is easy to write a script to do this so I am not sure that these kind of things should be built in.
tompe is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scariest Books Ever Written MV64 Reading Recommendations 58 01-25-2013 03:11 PM
Perl and Regex Alexander Turcic Lounge 3 01-25-2011 07:48 PM
This seems like a story wanting to be written kennyc Writers' Corner 3 12-26-2009 11:55 PM
MobiPerl: LIT2MOBI page breaks don't work =X= Kindle Formats 7 11-13-2008 11:08 AM
html2mobi (a mobigen replacement written in Perl) tompe Kindle Formats 89 02-12-2008 12:33 PM


All times are GMT -4. The time now is 12:02 AM.


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