Thread: EPUB output
View Single Post
Old 08-12-2010, 08:07 AM   #769
Ticallion
Connoisseur
Ticallion began at the beginning.
 
Posts: 61
Karma: 12
Join Date: Jan 2010
Device: Kindle PW
I'm not sure if this has been reported yet, I hope it will prove helpful though. I've been wanting and trying to convert my BookDesigner created LRFs to EPUB, but noticed Calibre kept messing up the links and making them either not function at all or jump to wrong pages. Such as selecting Chapter 1 would jump to Chapter 2, then using the back-link on Chapter 2 would jump to Chapter 1 instead of going back to the TOC as it should and does in the original LRF.

Well after trying once more, I opened a Converted EPUB in Sigil to check the code. I noticed what's been happening is Calibre is adding "#xx" where xx represents some numbers, to the end of each link both in the TOC and chapter headers. An example of a chapter header:

<a class="calibre5" href="../Text/53.xhtml#74">Part 1</a>

After removing "#74" in Sigil then saving the EPUB, now the link is working properly. Is there some reason Calibre is adding that extra stuff after ''xhtml'' and is there some way to perhaps prevent it? I have over 80 LRFs I'd like to convert to EPUB.


EDIT: Alright, now I know how to preserve spaces in the converted EPUB too. It seems Calibre is at least putting some code where the space should be. For example:

<p class="calibre1"><span>Text here.</span></p>

<p class="calibre1"></p>

<p class="calibre1"><span>Text here.</span></p>

The line "<p class="calibre1"></p>" is where the space is supposed to be, but it's not being read or whatever after conversion. So simply using find and replace, I changed the calibre1 part of the line to say calibre5, then in the stylesheet made calibre5 have a top and bottom margin setting of 1em. Now the output file looks exactly like the LRF.

So overall, the process involves a bit of work but not too much. First removing all the "#XX" parts then replacing the space codes.

Last edited by Ticallion; 08-12-2010 at 08:48 AM.
Ticallion is offline   Reply With Quote