Forum How do I...?

href in epub

fbrzvnrnd
Hi,

sometimes I use prince to convert ePub in pdf for my eReader that have not a ePub reader.
Often the ePub have internal hyperlink written as

<a href="namefile#poin2link">


This is right, but often the ePub uses this way when the link is inside the file too.
For example, in chapt1.html I can found a link to:

<a href="chapt1.html#poin2link">


instead:

<a href="#poin2link">


The chapt1.html#poin2link way is working in browser, in ePub reader, but not for prince. When I build the PDF the link is lost. Sometimes I change the xhtml, sometimes the files are too much splitted and I can not.
Is there a way to tell to prince to keep the internal link when there is the name of the current file before the # ?

Thank you.


f.
mikeday
This should work, try this simple sample document (save it as "test.html"):
<html>
<body>
<p>
<a href="test.html#chap1">chap1</a>
</p>
<div style="page-break-before: always" id="chap1">Chapter 1</div>
</body>
</html>

Unless the filename is changed, the link should work.
fbrzvnrnd
mikeday wrote:
This should work, try this simple sample document (save it as "test.html"):
Unless the filename is changed, the link should work.


Thank you, I'll try to understand what is wrong in other ePub.


f.