I did this (with a heap of help from this list). The approach was to convert
the base64 code to svg then serialize the svg as jpeg. Below is the sitemap
section and the xsl file. I think this was all I did but it was a while back
and am not able to put a working example together for you right now (check
archives for wordml images). If this doesn't get you across the line then
just ask another question and I'll try to help further.

Linc

-- sitemap.xmap snip--
<map:match pattern="**/_*.jpg">
  <map:generate src="content/content.xml"/>
   <map:transform src="stylesheets/wordml2svg.xsl">
     <map:parameter name="image" value="{2}"/>
   </map:transform>
   <map:serialize type="svg2jpeg"/>
</map:match>

-- wordml2svg.xsl --
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml";
xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint";
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">
        <xsl:param name="image"/>
        <xsl:template match="/">
                <xsl:apply-templates select="//w:pict"/>
        </xsl:template>
        <xsl:template match="//w:pict">
                <xsl:if test="v:shape/v:[EMAIL PROTECTED]:title=$image]">
                        <xsl:variable name="style" select="v:shape/@style"/>
                        <xsl:variable name="width"
select="substring-before(substring-after($style,'width:'),'pt')"/>
                        <xsl:variable name="height"
select="substring-before(substring-after($style,'height:'),'pt')"/>
                        <svg:svg xmlns:svg="http://www.w3.org/SVG";
width="{$width}pt" height="{$height}pt">
                                <svg:g>
                                        <svg:image
xmlns:xlink="http://www.w3.org/1999/xlink"; width="{$width}pt"
height="{$height}pt">
                                                        <xsl:attribute
name="xlink:href"><xsl:text>data:image/png;base64,</xsl:text><xsl:value-of
select="."/></xsl:attribute>
                                        </svg:image>
                                </svg:g>
                        </svg:svg>
                </xsl:if>
        </xsl:template>
</xsl:stylesheet>

----

-----Original Message-----
From: Jonas Lundberg [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 24, 2005 7:08 PM
To: [email protected]
Subject: Extract and display Base64 data from WordprocessorML?

WordprocessorML documents save images as Base64 blobs in the XML code.
Is there any way of extracting and displaying these images?
(I would not want to write a serializer for this, if there is one already)

Hans

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to