Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : lrf2lrs


igorsk
11-27-2006, 06:56 PM
I've updated the decompiler slightly so that it now handles all the sample boks bundled with the Reader. I was not able to get 100% recompilable files yet (it seems the format is changed slightly from Librie), but the produced .lrs should give you some insight into how to make better lrfs for Reader.
clicky (http://projects.mobileread.com/reader/users/igorsk/lrf2lrs_03.zip).

igorsk
11-27-2006, 07:09 PM
Actually I take that back... after I changed the BookID and removed the readings, I could recompile the "Winning" excerpt, and the footnote links worked! (at least in the Connect software... didn't try the Reader yet)

kovidgoyal
11-27-2006, 10:03 PM
cool thanks, this will be very useful.

NatCh
11-28-2006, 10:47 AM
igorsk, you continue to rock.

All of you ... 'unofficial developers' totally rock. :)

I just wanted to say that.

diabloNL
11-28-2006, 12:09 PM
igorsk, you continue to rock.

All of you ... 'unofficial developers' totally rock. :)

I just wanted to say that.


I totally agree with you NatCh! :cool:

igorsk
11-28-2006, 07:00 PM
Quick way to make the output .lrs compilable with lrs2lrf:
1) in the <BookInfo> section, remove all readings, e.g.:
<Title reading="">Winning (Excerpt)</Title>
2) for <BookID> tag, make first two characters read "FB", e.g.:
<BookID>FBUS12511000A00T</BookID>
3) compile away!

P.S. I didn't try it with all books. Let me know if you run into any issues.

kovidgoyal
11-28-2006, 10:59 PM
Do you know what the reading attribute is supposed to be for?

EDIT: Nevermind, its for sorting

diabloNL
12-02-2006, 07:06 AM
Does anybody know where to find xylogxml.dll that you need for lrs2lrf?

On the yahoo group I read it comes with BookCreator but I have that installed and it's not there.

Laurens
12-02-2006, 08:58 AM
I think it's bundled with the lrs2lrf distribution.

diabloNL
12-02-2006, 09:19 AM
I think it's bundled with the lrs2lrf distribution.

Could be but not under that name at least. The problem is that the lrf file created by lrs2lrf is 0 bytes. :(

EDIT: THis is the English translation of the error reported in the log file:

The forced termination which just does not have the file which
checks the consistency
of the file

igorsk
12-02-2006, 10:37 AM
I guess the .lrs generated by lrf2lrs was not valid. Which book did you try to decompile?

diabloNL
12-02-2006, 10:49 AM
I guess the .lrs generated by lrf2lrs was not valid. Which book did you try to decompile?


Different books that I created with makelrf. Then I converted them with lrf2lrs. But when I try to convert the unchanged file back with lrs2lrf it goes wrong.

Do you have a sample lrs file for me that should work?

diabloNL
12-03-2006, 04:36 AM
I got it to work. Played around with the header and then finally got it working. Thanks igorsk.

dmikov
12-09-2006, 05:43 PM
I have this error poping up and 0 bytes lrs as a result.
Parsing objects... done.
Traceback (most recent call last):
File "C:\lrf2lrs\lrf2lrs.py", line 1584, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\lrf2lrs\lrf2lrs.py", line 1578, in main
out.write(h.toXml());
File "C:\lrf2lrs\lrf2lrs.py", line 1511, in toXml
xml += self.objects[self.TocObjId].toXml(self.objects)
KeyError: 0
Any idea?

igorsk
12-09-2006, 09:10 PM
Looks like your file has no TOC specified... where did you get it?
You could fix the problemt by changing that line into:
if self.TocObjId in self.objects: xml += self.objects[self.TocObjId].toXml(self.objects)

dmikov
12-10-2006, 05:16 AM
Looks like your file has no TOC specified... where did you get it?
You could fix the problemt by changing that line into:
if self.TocObjId in self.objects: xml += self.objects[self.TocObjId].toXml(self.objects)
That was librie output of BookCreater. Thank you, the line change helped.
I can only say wow, for quick response.

igorsk
01-09-2007, 12:58 PM
New version, fixed decompiling of LRFs with embedded fonts and it should now work on Macs (thanks to grahame!).
http://projects.mobileread.com/reader/users/igorsk/lrf2lrs_04.zip

FangornUK
03-16-2007, 11:34 AM
Is it possible to add support for uncompressed LRF files like those generated by HTML2LRF?

igorsk
03-16-2007, 02:04 PM
I'm not sure why you consider them "uncompressed" but I will see what can be done for HTML2LRF's files.

FangornUK
03-16-2007, 02:29 PM
A better description would be that the files "aren't compressed", usually standard in LRF/LRX files? lrf2lrs gives a zlib error with the HTML2LRF files and the file sizes compared to ones generated by Book Designer are at least twice the size.

igorsk
03-16-2007, 06:00 PM
zlib error is caused by corrupted data, looks like the Librie DLLs have some bugs in them. And the larger size is because of inefficient conversion from HTML to LRF, with lots of redundant code.