It works! It seems that the Gen3 did not like images of size 600x800.
So here is the first release. The state of the code is very alpha. Please let me know if it does not work or if you find bugs or if you have suggestions for enhancements. I have tested with the Alice in Wonderland exemple from Mobipockets web site and I load it to my Gen3 and to my Palm T5 and read it. Here are the scripts:
http://www.ida.liu.se/~tompe/mobiperl/mobiperl-0.01.tar
Code:
perldoc -t html2mobi
NAME
html2mobi - A script to convert html files or an opf file to mobi
SYNOPSIS
html2mobi file.html
html2mobi file1.html file2.html ...
html2mobi file.opf
DESCRIPTION
A script to convert html files or an opf file to a mobi format file.
OPTIONS
--title TITLE
Specify the title for the book. This overrides the value given in
the opf file.
--mobifile MOBIFILE
Name of the output file. This overrides the default value.
--htmlfile HTMLFILE
Saves the html that is packed into mobi format. This html code
contains Mobipocket specific things that are added automatically.
This is mostly useful for debugging.
--coverimage IMAGE
The image to be used as cover in a library listing like the one in
Cybook Gen3. The image will be rescaled to a suitable format
(180x240). If no image is specified the first image in the source
files is used.
--gentoc
For a collection of html files generate the table of contents
automatically.
--pda
Scale images to work for pda's (must be used for Alice to work on my
Palm T5).
--scale f
Scale all images that are smaller then a certain size with scale
factor f.
EXAMPLES
html2mobi Alice_In_Wonderland.opf
html2mobi Alice_In_Wonderland.html
TODO
- Specify margins with flags
- Follow local links when given a root html file
BUGS
- Image sizes is not handled correctly for Palm T5. Large images
works on Gen3 but are problematic on T5.
- Guide specified toc not generated
- Not correct author in EXTH
- Plus a lot more.... this is an alpha version
AUTHOR
Tommy Persson (tpe@ida.liu.se)