![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
EPUB3 and svg files
Hi
I am looking for an example of a svg file integrated in an EPUB3 as a svg file (not inline within a html file). I had different tries and got trouble with the .opf part and the exact heading I am supposed to use (where DTD is said not to be welcome). Last edited by roger64; 05-11-2015 at 01:45 PM. |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Regards Rubén |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
If I insert the svg file inline, It looks easier and maybe it's the good solution... I managed to get an EPUB3 validated by Epubcheck this way and by just adding in the .opf file, for the item containing the svg file, the following expression: Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Scripler Project Lead
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19
Karma: 19304
Join Date: May 2014
Location: Copenhagen, Denmark.
Device: Gameboy Color
|
Are you asking about having the svg-files directly in spine?
Or whether to add the svg to the html file as a file or as xml (with the <svg> tags)? I have had good results with adding svg as images in the html files, inside svg tags (yes it's hacky)- it seems to be supported on most reader systems (e.g. ADE3 - I ignore ADE 4 as it was so bad in the beginning - but it might have become better). It also works when converting to kindle. Example: html (Side_02.html): Code:
<div> <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMin" version="1.1" viewBox="0 0 203 297" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"> <image height="297" width="203" xlink:href="../Images/02a.svg"/> </svg> </div> It is a bit of a hack, but it has worked consistently with many different titles - I have mostly used it for faking fixed format poetry in dynamic ebooks. opf: Code:
<item href="Text/Side_02.html" id="Side_02.html" media-type="application/xhtml+xml" properties="svg"/> <item href="Images/02a.svg" id="x02a.svg" media-type="image/svg+xml" /> |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@Scripler
Thank you for your sound advice. This is the way to go. Putting the svg files on the spine was a fantasy (until proved wrong). |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Regards Rubén |
|
![]() |
![]() |
![]() |
#8 | |
Scripler Project Lead
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19
Karma: 19304
Join Date: May 2014
Location: Copenhagen, Denmark.
Device: Gameboy Color
|
Quote:
I guess it should be possible to add images directly in spine according to the spec, not sure if that includes svg. But it is not really supported by any readers as far as I know. Would be great for a lot of stuff though - e.g. comics. |
|
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jul 2022
Device: none
|
SVG for Fixed Ebook Viewing
Hello,
I am new to this forum and this is my first time posting. I have been struggling to convert my physical book to an Epub3 for a few months. The challenges are that the book needs to be viewed in a fixed format and an audio player needs to display within the fixed page svg viewbox. I used a method similar to Abekonge to get the page displayed properly but have not figured out a way to incorporate the audio player into the SVG viewbox with the image. Currently, my audio player appears outside of the viewbox which creates problems in the e-reader. I need to find a way to display the audio box over the image within the SVG viewbox. Any help you could provide would be greatly appreciated! Thanks! Here's the code I've been using in the Epub3: <body> <h2 style="text-align: center; padding: 0pt; margin: 0pt;"> <audio controls="controls" src="../Audio/etude6.mp3">etude6</audio> <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 1020 660" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"> <image width="1020" height="660" xlink:href="../Images/painting6.png"/> </svg> </h2> </body> |
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
<body>
<div style="text-align: center; padding: 0pt; margin: 0pt;">
<svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 1020 760" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
<foreignObject x="0" y="0" width="1020" height="60">
<div xmlns="http://www.w3.org/1999/xhtml">
<audio controls="controls" src="../Audio/etude6.mp3"/>
</div>
</foreignObject>
<image x="0" y="70" width="1020" height="660" xlink:href="../Images/painting6.png"/>
</svg>
</div>
</body>
Well, that's all. I hope the code above can help you. Last edited by RbnJrg; 07-11-2022 at 01:12 PM. |
|
![]() |
![]() |
![]() |
#11 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,810
Karma: 103895653
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
It will only work, if at all, on apps, not on any ereader.
Either have no audio, or make apps for iOS and Android. Fixed layout are not real ebooks either. So many sizes of screens. |
![]() |
![]() |
![]() |
#12 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jul 2022
Device: none
|
Thank you so much! This is a huge help!
Is there any way to place the audio over the image? Quote:
|
|
![]() |
![]() |
![]() |
#13 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jul 2022
Device: none
|
Thank you, RbnJrg and Quoth!
I tried the code that RbnJrg provided but, as Quoth pointed out, the audio does not work in the Epub3 viewer. Is there another way to make this work? I have attached an image example of how I would like the page to appear. |
![]() |
![]() |
![]() |
#14 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Jul 2022
Device: none
|
Thank you, RbnJrg!
Unfortunately, the audio player does not display in my Epub3 reader when using this code. Do you know why that might be? Is there a way to overlap the audio on top of the image? |
![]() |
![]() |
![]() |
#15 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,663
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
And there is no other way to include inside a svg wrapper an audio control if not is using the <foreignObjetc> tag. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Epub3 XHTML Validation epub3 | Ramesh Arpitha | ePub | 5 | 06-30-2014 08:32 PM |
New Errors Converting epub3 -> zip -> epub3 | Lola25 | ePub | 2 | 11-12-2013 09:37 PM |
epub from SVG files | sachin | ePub | 7 | 05-11-2012 09:04 AM |
Which is the best way to add SVG (vector graphics) to PDF files ? | DSpider | 0 | 04-01-2011 07:27 PM |