![]() |
#1 |
Member
![]() Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
|
Prepagination
Hi,
First, thanks for the excellent work on calibre! I just discovered that news feeds in LRF format seem to reset the Reader (Sony PSR-505). As many have pointed out, two work-arounds are: 1) use EPUB, or 2) use LRF, but transfer the file to the Reader using Sony's software, which performs pre-pagination. While both approaches have worked, I would really like to use LRF *and* avoid reliance on Sony's software. I prefer LRF because it justifies text, whereas EPUB currently does not. And because I've been blessed/cursed with GNU/Linux, using Sony's software really isn't much of an option for me. Is there any way to add pre-pagination in calibre for LRF? Do we know how to it (but lack the manpower), or is there a fair amount of reverse-engineering that still needs to be done? Thanks! - e |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
|
Quote:
BOb |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
|
|
![]() |
![]() |
![]() |
#4 |
You really should try it!
![]() ![]() Posts: 57
Karma: 137
Join Date: Nov 2008
Device: PRS-500
|
I'm happy the question was asked, because until I read it I didn't know that epub doesn't justify text. I had been using LRF exclusively and hate justification.
Happy me! ![]() |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
|
Quote:
1. You would need to write it in Python. 2. You would need to determine how this is done by reverse engineering the indexing that the Sony eBook Library or the device itself does. I have no idea where this index is stored.. but possible Kovid or Igor could help you here. BOb |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,160
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The problem is you have to exactly duplicate the rendering algorithm used by SONY's LRF renderer. The LRF viewer in calibre comes close, but not quite. Once you do that, the rest should be easy.
|
![]() |
![]() |
![]() |
#7 | |
Member
![]() Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
|
Quote:
- e |
|
![]() |
![]() |
![]() |
#8 | |
Member
![]() Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
|
Quote:
Thanks, - e |
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,160
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#10 | |
Member
![]() Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
|
Quote:
You also seem to suggest that it is important to exactly duplicate Sony's LRF rendering algorithm *before* applying any pre-pagination. Assuming we know what the pre-pagination algorithm alone involves (do we?), what would happen if we simply apply pre-pagination to the calibre's LRF output? In other words, what do you hypothesize will happen if we skip Sony's LRF re-rendering step? Is the problem one of reverse-engineering, namely that we don't know what Sony's pagination algorithm involves, and that it's hard to diff calibre's LRF output with Sony's LRF output (with pagination) because there are too many things changing (i.e., Sony's rendering changes, plus pagination changes)? (Or did I miss a concept?) Thanks, - e |
|
![]() |
![]() |
![]() |
#11 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
|
Quote:
My guess would be if you are a bit off... it won't really hurt to much in that the page number may be a bit off. I could be wrong of course. BOb |
|
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,160
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look at the media.xml file on your device. It contains the prepagination information (hex encoded IIRC). LRF is a (partially) reflowable format. What the pre pagination does is tell the reader how many screens of text are there at a particular font size and where in the file each screen starts and ends. So to duplicate that, you have to layout the text on an in-memory screen exactly as the reader would. If you are a little off, that will result in missing lines of text, as you see when you replace the fonts on the reader with others that have different metrics and then try to use a pre paginated book
|
![]() |
![]() |
![]() |
#13 |
Reticulator of Tharn
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
|
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,160
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#15 |
Member
![]() Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
|
|
![]() |
![]() |
![]() |
Tags |
lrf, news, prepagination |
|