![]() |
#16 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,762
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() I will explain the things. First, the svg solution. You need to apply the "border" property (border: 10px solid black or whatever) to the tag <body>. Something like: Code:
<body style="border: 10px solid black; margin: 0; padding: 0"> Code:
<body class="bordered"> Code:
.bordered { border: 10px solid black; /* of course you change the border style here */ margin: 0; padding: 0 } After that, you need to use a svg image with a height and a width of 100% with no border; you can put whatever inside this svg, no problem with this. By using a svg image with a heigh and width of 100%, the body will be forced to expand with that size and you'll have what you want. Please, open the SVGepub2.epub book I attach in ADE 4.5 (or any ADE). It'll will show the borders as you want. The cause of your issues. Your problems are due to a bug in ADE 4.5 for svg images in epub3! There is no way you can have what you want, even by using javascript meanwhile ADE won't fix the svg bug. Please, open the SVGepub3.epub ebook I attach in ADE 4.5. That ebook is the same epub2 you opened previously but compiled/saved as epub3 with the Sigil plugin ePub3-itizer. As you will be able to see, the width is ok but the height isn't. If you open this same epub3 with Readium, the look will be perfect. For this reason, the ADE bug, you can't use a solution based on svg images. The perfect solution (?) I tried this only in ADE and with epub3. It won't work with epub2, only with epub3. But as you are working with epub3, this aproximation could work for you. Instead of using svg images, you will use tables! First, you need to define the height of the <html> and <body> tags in your .css file. The height of them is linked with the thickness of the border you want to use. With a thickness of 10px, I found a height of 95% works fine. The css style I used were: Code:
html { height: 95%; margin: 0; padding: 0; } body { height: 95%; margin: 0; padding: 0; border: 10px solid black; } #content { display: table; font-family: serif; height: 100%; width: 100%; margin: 0; padding: 0; text-indent: 0; text-align: center; } .row { display: table-cell; vertical-align: middle; height: 100%; font-size: 2em; font-family: sans-serif; font-weight: bold; color: purple; } Code:
<body> <div id="content"> <div class="row">#uno</div> </div> </body> Regards Rubén |
|
![]() |
![]() |
![]() |
#17 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
First of all, thank you for you answer. I'm reading it.
Unfortunately the solution you show is not good for me: the svg in example was only an example. The real svg+javascript is a more complex interactive animation, so I can not use a table instead (you can see the real svg in the second half of this video: https://www.facebook.com/fabrizio.ve...1500225007241/). Thanks again for the message. f. |
![]() |
![]() |
Advert | |
|
![]() |
#18 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,762
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() It looks fine. I attach a new epub (SVGepub3Ter.epub) so you can see better the things. Regards Rubén |
|
![]() |
![]() |
![]() |
#19 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
Quote:
Really interesting, thank you... it seems to work fine in ADE. But now it does not work in Ibooks: the table and SVG takes only 1/3 of the page... f. |
|
![]() |
![]() |
![]() |
#20 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,762
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() Regards |
|
![]() |
![]() |
Advert | |
|
![]() |
#21 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,726
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
As I've already suggested, there's no need to build two epubs, because the rendering engine can be easily detected by checking the navigator.epubReadingSystem.name value with JavaScript. (It returns RMSDK for ADE and ibooks for iBoooks.)
Once you know this value you could easily manipulate HTML and/or CSS to hide whatever code is not supported. |
![]() |
![]() |
![]() |
#22 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,762
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
![]() |
#23 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
Thank you for your answers. Tonight I was thinking to put together the RbnJrg and the Doitsu suggestions to try to have a unique EPUB3 working in ADE and Ibooks. navigator.epubReadingSystem.name seems to have some problem with Azardi, but I'm looking for a solution.
|
![]() |
![]() |
![]() |
#24 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
I'm stil testing but the patch RbnJrg and the Doitsu suggested seems to work. Btw ADE have got two different bug for SVG: in Macintosh version, if I have a landscape page, the SVG use only the width 100% and not the height one. In Windows version, in landscape or portrait page, the svg have a wrong scale, the image is very very little.
Anyway I'd like to add a "thank you" for RbnJrg and the Doitsu in my ebook (italian language). Could I use "RbnJrg and the Doitsu" or you have another name in real world? f. |
![]() |
![]() |
![]() |
#25 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
It sounds like you haven't updated the width and height properly on your svg files. You need to do that in two places for each svg:
Code:
<div class="fullimg"> <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 width height" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"> <image width="0" height="0" xlink:href="../Images/image.gif"></image> </svg> </div> |
![]() |
![]() |
![]() |
#26 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
Quote:
|
|
![]() |
![]() |
![]() |
#27 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,762
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
As far as I'm concerned, I really appreciate your will to write my name in your ebook as a acknowledgement; it's not neccesary but if you insist ![]() Regards Rubén Last edited by RbnJrg; 11-10-2016 at 01:14 PM. |
|
![]() |
![]() |
![]() |
#28 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,762
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() Regards |
|
![]() |
![]() |
![]() |
#29 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
|
![]() |
![]() |
![]() |
#30 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 557
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
Memo: the working code to catch "my" ADE problem is this:
Code:
try { //I check if the browser is the bleah ADE var lettore=navigator.epubReadingSystem.name; var adobeChiavicaMaledetta="RMSDK"; if (lettore==adobeChiavicaMaledetta) { document.getElementsByTagName("div")[0].className="content"; document.getElementsByTagName("div")[1].className="row"; } ///stop check } // stop trying to check catch(e) {// if the browser is bad and does not know epubReadingSystem method... } //please rest |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
EPUB3 and svg files | roger64 | ePub | 20 | 07-12-2022 01:19 PM |
ePub3: localStorage/JavaScript/RTL support | Doitsu | ePub | 7 | 06-02-2015 06:55 AM |
Is there any android epub reader supporting epub3 with audio/video/javascript? | happycoding | Android Developer's Corner | 10 | 07-29-2014 11:16 AM |
Create a javascript quizz for Epub3 in Sigil | BertrandThibaut | Sigil | 3 | 01-26-2014 09:04 AM |
JAVASCRIPT support in ePub2/ePub3 | Raja1205 | ePub | 7 | 09-03-2012 06:48 AM |