Description
The tool is called LRF2LRF. The main design of the tool is to change the font size and margins of LRF books. I designed this tool because I tend to find that most if not all LRF books tend to have huge fonts and large margins making. Of course users of this tool can also use it to increase the font and margin size as well.

The design:
This tool is a Perl script that calls Calibre’s lrf2lrs to generate the LRS file. Once the file is modified then calls LRS2LRF to create the LRF file once again.

Known Issues:
- There is a bug in Calibre's lrs2lrf tool that does not create the Header or Footer in the modified LRF file. (Calibre Ticket #909)
- Right Margin does not change (Top/Bottom/Left) margins can be changed (Calibe Ticket #911)

Below are some sample LRF files

INSTALLATION
This tool requires Calibe to run.
1) Put the script in the same location as the Calibe tool. (where lrf2lrs and lrs2lrf is located)
windows:
e.g. C:\Program Files\Calibe

X, first of all, have some karma for developing software for the Sony Reader! Secondly, how does one use it? Say I want to enlarge the text font for a particular book. I tried several combinations of command strings on my test book, and all I was able to do was enlarge the title.

Looks good, very useful for people like me that often want to get rid of margins and make the font size more usable... I'm currently at ~7.8pt and dropping. Looking for the point where I get most on the screen without killing my reading speed through too-small text.

I'm a newb, but I can't get the script to run. I've put the lrf2lrf file in the calibre directory, but when i go to cmd window and type in lrf2lrf or anything else suggested here it says "lrf2lrf is not recognized as an internal or external command, operable program or batch file."

I would like to use this utility but I can't get it to work. It produces the output file OK, but I can't see any changes - I'm trying to reduce the font from 10 to 8 pt, and reduce margins too.

This is the command line I am using:

lrf2lrf -s 80 -t 0 -b 0 -l 0 -r 0 -o NewLrfFileOldLrfFile

and this is the output:

Code:

Reformatting Silverberg-Live-Again.lrf
Parsing LRF...
Creating XML...
LRS written to .Silverberg-Live-Again.lrs.tmp
LOOKING FOR 72, 75, 80
Parsing LRS file...
Writing to output file...
Output written to E:\My Documents\My Library\Reader\Books\Silverberg-Live-Again.
new.lrf
This exe file was created with the evaluation version of Perl2Exe.
For more information visit http://www.indigostar.com
(The full version does not display this message with a 2 second delay.)

The commands you are using is correct. However you'll need to specify yet another switch.

What happens is the software tries to guess which is the font you want to change by looking at the highest occurrence. This works most of the time, but there are a few LRF out there that don't follow this pattern.

Thanks for your help, and such a nice little utility! This is just the thing I need as I like to reformat the lrfs I download in order to get as much text as possible on the screen (smaller fonts and margins).

I have converted the lrf to lrs and found that 75 is used for chapter numbers, whereas 77 is used for the actual body text. Note that objid 77 has 20 occurrences, whereas objid 75 has 2 more - so when I used the -s switch before, it would have changed object 75 and not 77.

This did not work - for some reason it is not looking for objid 77. If we could get this to work it would be great - I could automate conversions by just using -f, and not have to use -e and -x for each book.

I probably want to change the font size for the chapter numbers too - is it possible to have multiple objids for the -x command? (But fixing the -f command would be just as good).

The other thing that occurs to me - when using -s without -x, I believe lrf2lrf uses the maximum number of occurrences to decide which objid to change. This does not work with the Silverberg book because there are in fact more chapter numbers; could the size of the textblock be considered too?

As an example, here are the first two textblocks from a page from the book:

Code:

<Page pagestyle="72" objid="28">
<TextBlock objid="20" blockstyle="76" textstyle="75">
<P>1</P><CR /></TextBlock>
<TextBlock objid="21" blockstyle="76" textstyle="77">
<P>The lamasery rose steeply from the top of the bluff on the Marin County side of the Golden Gate. Feeling a faint cramp in his left calf, John Roditis got out of the car near the toll plaza and, stretching and kicking, looked across the water at the gleaming yellow building, windowless, sleek, ineffably holy as a fountainhead of good karma. It was an extraordinarily warm day. yada yada yada</P><CR /></TextBlock>
</Page>

The length of the inner xml for TextBlock 77 is always much longer than for 75, so that should be the objid to change. I guess this will be true for most ebooks - there will always be an TextBlock element that is much longer than all the others.