View Single Post
Old 10-04-2023, 09:12 AM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,860
Karma: 6120478
Join Date: Nov 2009
Device: many
And once you have a cover page that works on all the reading platforms you want, remember to save just that file using Sigil's BookBrowser and you can use it to create your own cover template that Sigil can then use in place of its own.

To create the template start with your saved version and use placeholders to replace image specific items (see below) to create a cover-template2.xhtml and/or cover-template3.xhtml and placie it into your Sigil Preferences folder. It will be used next time.

To illustrate here is the epub3 default cover source code that shows the placeholders and how they are used:

Code:
const QString HTML5_COVER_SOURCE =
    "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n"
    "<!DOCTYPE html>\n\n"
    "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:epub=\"http://www.idpf.org/2007/ops\">\n"
    "<head>\n"
    "  <title>Cover</title>\n"
    "</head>\n"
    ""
    "<body>\n"
    "  <div style=\"height: 100vh; text-align: center; padding: 0pt; margin: 0pt;\">\n"
    "    <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"100%\" preserveAspectRatio=\"xMidYMid meet\" version=\"1.1\" viewBox=\"0 0 SGC_IMAGE_WIDTH SGC_IMAGE_HEIGHT\" width=\"100%\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n"
    "      <image width=\"SGC_IMAGE_WIDTH\" height=\"SGC_IMAGE_HEIGHT\" xlink:href=\"SGC_IMAGE_FILENAME\"/>\n"
    "    </svg>\n"
    "  </div>\n"
    "</body>\n"
    "</html>\n";
Sigil will automatically fill these values for you (things that change for every image).


SGC_IMAGE_WIDTH
SGC_IMAGE_HEIGHT
SGC_IMAGE_FILENAME

In your case you would need to tweak the height: 100vh to 95vh in the div's inline style.

Hope this helps.

Last edited by KevinH; 10-04-2023 at 09:28 AM.
KevinH is offline   Reply With Quote