View Single Post
Old 04-04-2015, 04:12 PM   #4
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,827
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Use the following code:

1. In your .css stylesheet:

Code:
p {
    text-align: justify;
    text-indent: 1em;
    font-size: 1em;
    margin-bottom: 1em;
}
2. In your .xhtml file:

Code:
<body>
<div>
  <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 248 360" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
    <image height="310" width="248" xlink:href="../Images/Obama.jpg"/>

    <text text-anchor="middle" x="124" y="330">
      Barak Obama

      <tspan x="124" y="350">President of the United States of America</tspan>
    </text>
  </svg>
</div>
</body>
Of course, the size of your image will be different. Also take in count that while the image size is of 248x310px, the viewbox of the svg wrapper is of 248x360 (the differnce in height is due to the space for captions). It works EVEN on ADE 2.0; here you can see a screenshot:

Click image for larger version

Name:	Image1.png
Views:	340
Size:	133.0 KB
ID:	136801

Below you can check the respective .epub.

Regards
Rubén
Attached Files
File Type: epub Image & Caption for ADE.epub (17.9 KB, 238 views)

Last edited by RbnJrg; 04-04-2015 at 04:24 PM.
RbnJrg is offline   Reply With Quote