View Full Version : Can someone help me reformat my lrf files?

10-03-2009, 05:59 AM
I've gotten a load of LRF format books, but they've obviously been pre-converted from another format.

So there are page breaks at what was probably the right place in the original format, but on my PRS 505 it means that sometimes there's page breaks mid sentence.

I converted a book to xml to see what was going on, and each page is broken by the following:

<TextBlock objid="165386" blockstyle="166319" textstyle="166318">
<P><Span fontweight="700"><Italic>Part 1</Italic><Span fontweight="400"><CR /><Span fontweight="700">PROVENER<Span fontweight="400"><CR /></Span></Span></Span></Span></P></TextBlock>


<Page pagestyle="166317" objid="165389">

I noticed that the objid is not the same for each 'page' in the book, so I can't do a find and replace.

I guess the regexp functionality may help to strip these out?

Also, is there a way to test to see if the last character of a text block is a fullstop or equivalent so that if it is, I insert a line break, and if it's not it just leaves a space between the next word at the start of the next text block?

Is it possible to put some parameters or regexp into Calibre and convert to epub or lrf with the desired formatting?

Thanks a lot!