View Single Post
Old 12-21-2006, 05:59 PM   #1
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Converting Baen books to LRF

I've been playing around with Baen free books and HTML2LRF. To make my life easier I made a Python script to prepare the books for better results. Here's a little tutorial.
1. Download HTML2LRF 0.3:
http://projects.mobileread.com/reade...ML2LRF-0.3.ZIP
2. Go to Baen's free library and find the book you want to convert. Copy the main book URL. E.g. http://www.baen.com/library/0671319728/0671319728.htm for Eric Flint's 1632.
3. Run baen.by with the URL:
baen.py http://www.baen.com/library/0671319728/0671319728.htm
4. The script should produce two files, "Author - Title.rsp" and "Author - Title.bat". E.g. "Eric Flint - 1632.rsp" and "Eric Flint - 1632.bat".
5. Run the .bat file. It should start HTML2LRF and parse all of the book's pages. It will produce "Author - Title.lrf", e.g. "Eric Flint - 1632.lrf".
6. Load on the Reader and enjoy!

Pros of this method:
1) Table of contents.
2) Metadata
3) Pictures!
4) Supposedly better text rendering (trivia: LRF render uses FontFusion, while RTF render uses freetype).
Cons:
1) No cover picture

Hints:
1) You can convert books downloaded to your hard drive (e.g. purchased from Webscriptions or taken from Baen CDs). Just pass the full path to the main html file to baen.py (don't forget quotes if it has spaces):
baen.py "c:\books\Baen CD 01\On Basilisk Station\On_Basilisk_Station.htm"
2) Edit the .rsp before running the .bat file to fix possible problems in the author name/title or TOC entries. For example, baen.py doesn't replace & with &. You can also change the output filename (the O: line).
igorsk is offline   Reply With Quote