![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
|
HTML2LRF
Just a little tool I made using DLLs from the Toolbar for LIBRIe. It's basically a command-line version of the toolbar.
Features:
Issues:
HTML2LRF [-t "Book title"] [-a "Book Author"] [-o output_filename] <url|path.html> [<url|path.html>...] Defaults are "Test Book", "Unknown Author", and "test.lrf". Hints:
Clicky |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,160
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
cool I'm going to try to get this going under wine as soon as I get some time.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Addict
![]() ![]() Posts: 285
Karma: 129
Join Date: Sep 2006
Location: New England
Device: PRS-500 · iPad · K3
|
Quote:
![]() Quick question, if Russian fonts installed on the Reader, will russian characters be displayed in LRF? |
|
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 364
Karma: 1035291
Join Date: Jul 2006
Location: Redmond, WA
Device: iPad Mini,Kindle Paperwhite
|
Igor, maybe you should mention this in the Content subforum.
|
![]() |
![]() |
![]() |
#5 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
I call this application BBeBook. It is far from perfect/complete in its understanding of LRF, but It is written 100% in Java and needs no dll's from Sony. It is Unicode clean.
It uses a couple public java libraries: xpp3 and jpedal. It can re-flow HTML and PDF documents into LRF files. It has latent support for rasterizing PDF files into PNG's in the LRF (non-reflow). It comes with a sample Creative Commons ebook to bind with it: Cory Doctorow's Someone Comes to Town, Someone Leaves Town. I've GPL'd the tool (not Cory's book), have fun. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,160
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Looks good scotty, though is there a command line interface? I find GUIs really awkward for these kinds of jobs.
|
![]() |
![]() |
![]() |
#7 |
Connoisseur
![]() Posts: 54
Karma: 29
Join Date: Oct 2006
|
Scotty,
Not sure if you noticed the tool lrf2lrs on the librie yahoo group - you can use it to extract lrf's back to lrs source files. Sony didn't encrypt the sample books they provided on the reader - they are just plain lrfs. Using the lrf2lrs tool you can extract most of them (some don't work) and take a look at their construction. It may help with understanding some of the lrf format. I think the ones that don't work have tags that the librie doesn't use. Based on the headers it looks like Sony is creating their content using BookCreator. Rob |
![]() |
![]() |
![]() |
#8 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 556
Karma: 1057213
Join Date: Sep 2006
Location: North Eastern U.S.
Device: Sony Reader
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
It uses an XML file to supply the dublin core data for the book in command line mode. An example of which is included for the example book. The tool knows how to resize a front cover image into the thumbnail to embed into the LRF file as well (one less thing to create yourself.) |
|
![]() |
![]() |
![]() |
#10 | |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
I have my own Java LRF dumper as well. I've spent much time pulling apart LRF files. My focus with this tool is in producing re-flowable LRF files. Book Creator, Book Designer focus on page layout oriented books that are more awkward to magnify. Unfortunately the Sony Reader I ordered opening day, and was only recently delivered, died after 2 hours of operation. It has yet to be replaced. I live in a "dead zone" of local availability, as I live far too close to geekraver to be able to get a local replacement. ![]() |
|
![]() |
![]() |
![]() |
#11 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 556
Karma: 1057213
Join Date: Sep 2006
Location: North Eastern U.S.
Device: Sony Reader
|
Quote:
Actually, the links do appear to work. ![]() I wonder if Sony provided a way to specify the font size of the book, the genre (right now hardcoded some Japanese word), the line spacing? The font appears kinda a bit small, the margins - kinda a bit too wide, the line spacing is OK, but could be a bit tighter. The book looks nice, though. Thanks Last edited by porkupan; 11-02-2006 at 11:07 AM. |
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
|
The text styles are specified in the "DesignHorizontal.lrf" file. You could try decompiling it with lrf2lrs, adjusting things you need, and compiling back.
As for the genre, it is indeed hardcoded but you can change it with the EditLRFMeta tool. |
![]() |
![]() |
![]() |
#13 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 556
Karma: 1057213
Join Date: Sep 2006
Location: North Eastern U.S.
Device: Sony Reader
|
For whatever reason the program crashes on some of the HTML files for me. Seems to depend on the size of the file. For instance, this one crashes, but smaller ones don't. Not sure where the limit is, and if it really is the file size that kills it.
BTW, my attempts to decipher the DesignHorisontal.lrf with lrf2lrs were unsuccessful. The scripts unloads with the error message: Traceback (most recent call last): File "H:\boroda\HTML2LRF-0.1\bin\lrf2lrs.py", line 1506, in <module> sys.exit(main(sys.argv[1:])) File "H:\boroda\HTML2LRF-0.1\bin\lrf2lrs.py", line 1500, in main out.write(h.toXml()); File "H:\boroda\HTML2LRF-0.1\bin\lrf2lrs.py", line 1480, in toXml xml += o.toXml(self.objects) File "H:\boroda\HTML2LRF-0.1\bin\lrf2lrs.py", line 498, in toXml f = StringIO.StringIO(self.stream) AttributeError: LRFHeader instance has no attribute 'stream' |
![]() |
![]() |
![]() |
#14 | |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 |
Addict
![]() ![]() ![]() ![]() Posts: 206
Karma: 317
Join Date: Oct 2006
Location: England
Device: Sony PRS-505, iPad, Kindle 3
|
Scotty1024, perhaps I'm missing something obvious but how do you use your BBeBook software? I don't know much about Java.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
HTML2LRF and inline pictures | pepak | Calibre | 12 | 02-04-2009 12:12 PM |
chaining web2disk to html2lrf | beowulf573 | Calibre | 2 | 11-19-2008 04:48 PM |
Bookdesigner problem vs. html2lrf | alophind | Sony Reader | 7 | 02-04-2008 12:20 PM |
PRS-500 Need help with Html2Lrf (screen attached) | alophind | Sony Reader Dev Corner | 14 | 02-01-2008 03:56 AM |
html2lrf vs rtf2lrf | paspas | Sony Reader | 0 | 11-18-2007 02:35 PM |