Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2008, 05:32 PM   #1
Seligman
Junior Member
Seligman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2008
Device: PRS-505
Layout format?

Does anyone have any details for how the layout data is stored in \database\cache\media.xml under the xdbLite/records/xs1:text/xs1:layouts/xs1:layout nodes?

I have a little pet project that would benefit from being able to read this information on the desktop, but before I go digging into this mime encoded blob and see how it's crafted, I thought I'd ask if someone else has a clue how the data is stored.

Thanks!
Seligman is offline   Reply With Quote
Old 05-12-2008, 05:59 PM   #2
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
It's pretty complex and it's specific to a file format (i.e., txt, rtf, lrf all use it differently). Basically it describes the position in file at which every page starts. Naturally, it depends on the actual font and rendering algorithm used. Even a slight disrepancy can lead to the "missing lines" problem that many people had when replacing fonts on the device but forgetting to replace them on the PC.
If you still want to know the details I will try to describe them. I don't really see how it will be useful to you since you'll need to reproduce the LRF rendering very closely to how Reader does it and that's not trivial...
igorsk is offline   Reply With Quote
 
Enthusiast
Old 05-12-2008, 06:10 PM   #3
Seligman
Junior Member
Seligman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2008
Device: PRS-505
Quote:
Originally Posted by igorsk View Post
It's pretty complex and it's specific to a file format (i.e., txt, rtf, lrf all use it differently). Basically it describes the position in file at which every page starts. Naturally, it depends on the actual font and rendering algorithm used. Even a slight disrepancy can lead to the "missing lines" problem that many people had when replacing fonts on the device but forgetting to replace them on the PC.
If you still want to know the details I will try to describe them. I don't really see how it will be useful to you since you'll need to reproduce the LRF rendering very closely to how Reader does it and that's not trivial...
Yeah, I assumed it wouldn't be enough to recreate the output. Basically, in my project it would be useful if I could get at "page x starts at y bytes into the file".

Any hints as to the format you could give would be much appreciated. If it makes your life any easier, I really only care about the lrf format.
Seligman is offline   Reply With Quote
Old 05-12-2008, 06:11 PM   #4
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,453
Karma: 5657812
Join Date: Jun 2006
Location: Pittsburgh, PA USA
Device: Kobo Aura (soon), (soon-to-be-ex)nook, (ex)PRS-700, (ex)PRS-500
Quote:
Originally Posted by igorsk View Post
It's pretty complex and it's specific to a file format (i.e., txt, rtf, lrf all use it differently). Basically it describes the position in file at which every page starts. Naturally, it depends on the actual font and rendering algorithm used. Even a slight disrepancy can lead to the "missing lines" problem that many people had when replacing fonts on the device but forgetting to replace them on the PC.
If you still want to know the details I will try to describe them. I don't really see how it will be useful to you since you'll need to reproduce the LRF rendering very closely to how Reader does it and that's not trivial...
A much more interesting goal would be to understand enough about what's in there to let calibre fetch the information back for books it has previously downloaded to the reader. That way, those of us with non-Windows boxen would only have to eat the format-time once on the reader. Calibre could store it with the book and re-load it on subsequent downloads.

Now that would be spiffy!

In fact, if someone out there has enough information on the subject, I'll be happy to file an enhancement request.

Xenophon
Xenophon is offline   Reply With Quote
Old 05-12-2008, 06:30 PM   #5
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Quote:
Originally Posted by Xenophon View Post
A much more interesting goal would be to understand enough about what's in there to let calibre fetch the information back for books it has previously downloaded to the reader. That way, those of us with non-Windows boxen would only have to eat the format-time once on the reader. Calibre could store it with the book and re-load it on subsequent downloads.
Now that would be spiffy!
In fact, if someone out there has enough information on the subject, I'll be happy to file an enhancement request.
For that, storing the binary blob should be enough I think.
igorsk is offline   Reply With Quote
Old 05-12-2008, 06:38 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,949
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Xenophon View Post
A much more interesting goal would be to understand enough about what's in there to let calibre fetch the information back for books it has previously downloaded to the reader. That way, those of us with non-Windows boxen would only have to eat the format-time once on the reader. Calibre could store it with the book and re-load it on subsequent downloads.

Now that would be spiffy!

In fact, if someone out there has enough information on the subject, I'll be happy to file an enhancement request.

Xenophon
Do you often download the same book to your reader multiple times?
kovidgoyal is online now   Reply With Quote
Old 05-12-2008, 09:55 PM   #7
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,453
Karma: 5657812
Join Date: Jun 2006
Location: Pittsburgh, PA USA
Device: Kobo Aura (soon), (soon-to-be-ex)nook, (ex)PRS-700, (ex)PRS-500
Quote:
Originally Posted by kovidgoyal View Post
Do you often download the same book to your reader multiple times?
Yes. I shuffle what's on the reader fairly regularly, especially since I've gotten tired of waiting for the reader to scan its way through a GB or so on an SD card. Also, the reader loses track of that data lots of times when it crashes, so I'd like to be able to put the relevant bits into the layout nodes again rather than eat yet another re-format. And it would also help in multi-reader households like mine -- lots of stuff that I've read that my wife hasn't read yet. This could save her waiting for the format too.

Also, I re-read favorites a fair bit, because my main sources of fiction don't put out enough new content (that I can afford) to keep me in fresh reading material.

Finally, we could (somehow) store the information with the lrf files here on MobileRead too. That would benefit everyone who doesn't use Windows, by letting us avoid the first re-format as well.

(OK, I know, it wouldn't help anyone who changes font sizes or sticks a different set of fonts on their reader. But still...)

Xenophon
'

Last edited by Xenophon; 05-12-2008 at 09:56 PM. Reason: added multi-reader observation.
Xenophon is offline   Reply With Quote
Old 05-12-2008, 10:15 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,949
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm, well saving the layout formats is certainly possible. But it would be way down my TODO list
kovidgoyal is online now   Reply With Quote
Old 06-17-2008, 06:10 PM   #9
Seligman
Junior Member
Seligman began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2008
Device: PRS-505
Quote:
Originally Posted by igorsk View Post
If you still want to know the details I will try to describe them. I don't really see how it will be useful to you since you'll need to reproduce the LRF rendering very closely to how Reader does it and that's not trivial...
Are you still willing to document what you know of the format?

Thanks!
Seligman is offline   Reply With Quote
Old 06-19-2008, 05:29 AM   #10
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Yes, but not anytime soon, sorry.
igorsk is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restoring the old layout Ross Smith Calibre 9 06-24-2010 02:01 PM
ePub with two column layout bhuvana786 ePub 3 02-19-2010 07:35 PM
Appalling layout StanByk PDF 27 05-09-2009 02:46 PM
Hanlin Forum layout mvoosten HanLin eBook 7 12-14-2007 03:42 AM


All times are GMT -4. The time now is 04:44 AM.


MobileRead.com is a privately owned, operated and funded community.