Page 1 of 1

DocBook to ePUB with SVG?

Posted: Wed Sep 14, 2011 9:12 pm
by msarrel
I'm trying to convert a DocBook file with SVG images to ePUB. The problem is that the images don't appear in the ePUB. Neither the DocBook nor SVG files have validation errors. Here is the <imageobject> fragment from DocBook.

Any ideas?

Code: Select all

<mediaobject>
<imageobject>
<imagedata fileref="test_files/_17_0_2_31d104c4_1315959697454_106692_95624.svg" format="SVG" scalefit="1" width="100%"/>
</imageobject>
</mediaobject>

Re: DocBook to ePUB with SVG?

Posted: Thu Sep 15, 2011 10:54 am
by Radu
Hi,

There is a problem in the stylesheet used to copy referenced images to the output folder.
We'll correct it and the fix will probably be included in Oxygen 13.1 in a couple of months.
Until then you can open the stylesheet:

OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/epub/images.xsl

and add in it the following xsl:template:

Code: Select all

  <xsl:template match="@data[parent::xhtml:object[@type='image/svg+xml']]">
<xsl:variable name="imagePath" select="XSLTExtensionIOUtil:copyFile($inputDir, ., $outputDir, $imagesDir)"/>
<xsl:attribute name="data"><xsl:value-of select="$imagePath"/></xsl:attribute>
</xsl:template>
Regards,
Radu