DocTheEbook: LrfFormat ...
Наблюдать | Версия для печати | Вход:   Пароль:  


Оглавление документа

Some information is available in emails from the Yahoo!
Librie group:

A LRF file consists of a header, a number of objects and an object index. All values are in Intel (LSB first) order.


Offset (hex) Size(bytes) Name/meaning Example value
0 8 LRF Signature 4C 00 52 00 46 00 00 00 = “LRF” in Unicode
8 2 version? 999 in most files
2 Psuedo Encryption key byte 48
0C 4 Root Object ID? 0x0044
10 8 Number Of Objects? 342
18 8 Object Index Offset? 0x00093440
20 4 unknown 0
24 1 Flags (16 – back to front, 1 = front to back) 16
25 1 unknown (padding?) 0
26 2 unknown 1600
28 2 unknown (padding?) 0
2A 2 Height? 600
2C 2 Width? 800
2E 1 unknown 24
2F 1 unknown (padding?) 0
30 0x14 unknown zeroes
44 4 Toc Object ID? 0x0042
48 4 Toc Object Offset? 0x1536
4C 2 XMLCompSize 0x035C

Next two fields are only present if version>=800.

4E 2 Thumb Image Type? 0x0014 for GIF
0x0012 for PNG
0x0013 for BMP
0x0011 for JPEG
50 4 Gif Size? 0x03F2

Immediately follows the compressed XML metainfo, of size XMLCompSize. First dword of it is the size of uncompressed data, the rest is zlib compressed unicode XML.

If version>=800, the gif thumbnail follows, of size Gif Size?.

Object index

Offset to the index is specified by the Object Index Offset? in the header, and number of entries is Number Of Objects?.

Each index entry has the following layout:

Offset (hex) Size(bytes) Name/meaning Example value
00 4 id  0x32
04 4 offset 0x07B0
08 4 size 0x44
0C 4 reserved? 0


See LrfObject for details.

Logical structure

Structure of a simple BBeB book:












Root Object ID? field in the LRF header points to a Book Atr? object, which sets some common properties for the book, and in turn points to a Page Tree? object. Page Tree? has a list of Pages in the book, in the reading order. A Page can contains some Blocks and Canvases. Each Block can be positioned on the page indepentently. A Block can contain a single passage of Text, Simple Text?, Image, Button (and some others, I think). Text and Simple Text? contain a stream of text with possibly some embedded tags. An Image points to an Image Stream? object, which contains the binary stream of the image. (Several Images can point to a common Image Stream?, each representing a portion of the whole bitmap.) Button can be used as a hyperlink – to jump to another portion of the book.

Toc Object ID? and Toc Object Offset? in the header point to a single Toc (table of contents) object, which is basically a list of links to some parts of the book.