View Single Post
Old 05-24-2018, 11:58 AM   #7
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

I did some tries I used the same source ePub containing an image 606×912, size 49.5KB format jpg.

I converted to PDF with Calibre using the code given above
I converted to PDF with Calibre using the code for SVG images provided by the InsertImageSVG v 1.4.0 Sigil plugin.

Spoiler:

Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <title></title>
  <style type="text/css">
  @page {
    padding: 0;
    margin: 0;
    }
  body {
    text-align: center;
    padding: 0;
    margin: 0;
  }
  </style>
</head>

<body>

  <div>

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="100%" width="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 264 400">
      <image width="264" height="400" xlink:href="../Images/xxx.jpg"/>
    </svg>

  </div>

</body>

</html>


These two kinds of code gave exactly the same results*. (see left screenhot1). There are document margins around the image (including vertical margins).

If I convert to PDF with Prince using the code given above, (see right screenshot2). There are NO document margins around the image (only the 6% left and right due to the shape of the image).

So, with Calibre, even with a svg wrapper, the display is not the one expected. The only exception with Calibre, concerns the cover image which can be displayed without document margins.

Why, what can be done for the cover image could not be extended to other full page images using the same code?

* Note that I do not pretend that these two codes are equivalent. If the results are the same for this particular test, it is because the first code is calculated for screens with a 3/4 ratio. There would be differences for others shapes of screen.
Attached Thumbnails
Click image for larger version

Name:	photo1svg.jpg
Views:	263
Size:	19.5 KB
ID:	164093   Click image for larger version

Name:	photo2Prince.jpg
Views:	276
Size:	19.5 KB
ID:	164094  

Last edited by roger64; 05-24-2018 at 12:43 PM.
roger64 is offline   Reply With Quote