05-19-2015, 11:10 PM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: May 2015
Device: iPad, iPhone
|
Conversion from xhtml to epub loose svg images
Thanks for making calibre available. Apologies if I am making a rookie error, but I have a Latex-driven workflow that produces a xhtml book with numerous svg illustrations. The xhtml file view fine in a browser. I then run
ebook-convert DA1_book.xhtml DA1_book.epub but find that the hrefs to svg files in the various xhtml sections are gone, yet all the svg files are included in the epub file. E.g, the original lines like <div id="Ch1.F1" class="ltx_figure"><object data="Fig1_dataclasses.svg" id="Ch1.F1.g1" class="ltx_graphics ltx_centering" width="470" height="133" alt=""/> are not present in the epub archive but all the SVG files are there. When importing the epub (or xhtml) into calibre and trying to view it I get the error "No book with id 13 present". Opening the epub in iBooks also shows no figures. Am I missing an option? |
05-19-2015, 11:12 PM | #2 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Dont use <object> to include svg images, use <img> (but note that many viewers, including the calibre viewer, have problems with svg images included via <img> that themselves include other images. The best way to include svg images is to embed them directly in the html with <svg> tags.
|
Advert | |
|
05-24-2015, 09:04 PM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: May 2015
Device: iPad, iPhone
|
Thanks for the tip. Turned out adding type="image/svg+xml" to the <object> tag worked wonders. I passed this to the developers of LatexML who have added this as well.
Trying to validate my EPUB with epubcheck revealed that while my Latexml-derived EPUB is v3.0, when using Calibre to make some edits it saves only (?) as EPUB v 2.0, which then fails the epubcheck since the file contains MathML and xml/svg. Can Calibre write EPUB3 files? Am I missing an options? |
05-24-2015, 11:29 PM | #4 |
creator of calibre
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No calibre does not support epub 3.
|
Tags |
svg images |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Guide for converting Kindle Topaz (xhtml with svg) to PDF | Fschumaur | Workshop | 5 | 03-27-2015 01:35 AM |
MathJax and SVG conversion problems to epub or MOBI | waiting90days | Conversion | 4 | 12-31-2013 10:15 PM |
XHTML fallback for SVG | Iznogood | ePub | 15 | 10-08-2012 07:52 PM |
epub-kindle conversion blanks svg with text | bobb40 | Conversion | 2 | 09-28-2012 08:05 AM |
How can I convert topaz ebook from multiple xhtml's (SVG) to single pdf? | rglk | Workshop | 3 | 11-28-2011 04:33 PM |