View Single Post
Old 05-19-2013, 01:52 PM   #468
Anak
Guru
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 600
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Quote:
Originally Posted by Quexos View Post
Thanks for this code
but I still don't know whether this goes to the css file or maybe that other file with opf extension or elsewhere.
Besides is this standard code or code specific to one ebook. After all one cannot just take the css of one book and copy paste it to another's.

If book publishers and e-readers brands did their job we wouldn't have to bother messing with the code.


Code:
  <div>
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 296 475" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
      <image height="475" width="296" xlink:href="../Images/cover.jpeg"></image>
    </svg>
  </div>
The above code should be placed in the first file of the document of the file where the cover is (.xhmtl or html). At best is to place a cover in its own file and the first file in the epub. Check if it contains a link to a stylesheet.
In de CSS. Be sure that margins set to zero, like
@page {margin:0;}
p {margin:0;padding:0;}
div {margin:0;}

Change the image dimensions in the svg code to the exact image demensions of your cover file

If you have a cover of 1200×800 px, the code should look like

Code:
  <div>
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 800 1200" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
      <image height="1200" width="800" xlink:href="../Images/cover.jpeg"></image>
    </svg>
  </div>
[/QUOTE]
Anak is offline   Reply With Quote