Fw: [xep-support] viewBox with rotated SVG
Stijn Elst
stijn at fotek.com
Tue Apr 4 08:12:31 PDT 2006
Never mind, it's fairly easy when you rotate AND translate...
----- Original Message -----
From: Stijn Elst
To: xep-support at renderx.com
Sent: Monday, April 03, 2006 1:00 PM
Subject: [xep-support] viewBox with rotated SVG
Hi,
I'm trying to rotate an image (eg. 5°) using SVG. Here's my (simplified) code (width & height in mm):
<xsl:template match="PICTURE">
<fo:block-container absolute-position="absolute">
<xsl:attribute name="top"><xsl:value-of select="@TOP" /></xsl:attribute>
<xsl:attribute name="left"><xsl:value-of select="@LEFT" /></xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="@WIDTH" /></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="@HEIGHT" /></xsl:attribute>
<fo:block>
<fo:instream-foreign-object>
<xsl:attribute name="content-width"><xsl:value-of select="@WIDTH" /></xsl:attribute>
<xsl:attribute name="content-height"><xsl:value-of select="@HEIGHT" /></xsl:attribute>
<svg:svg preserveAspectRatio="none meet">
<xsl:attribute name="width"><xsl:value-of select="@WIDTH" /></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="@HEIGHT" /></xsl:attribute>
<svg:image xlink:href="{@FILE}" transform="rotate(5)"/>
</svg:svg>
</fo:instream-foreign-object>
</fo:block>
</fo:block-container>
</xsl:template>
The resulting pdf contains indeed the rotated image, but it appears to be magnified. Also, the viewBox attr needs to be set. Is there an easy way to dynamically set the viewBox based on the rotation angle in the XSL?
Regards,
Stijn Elst.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20060404/5355d79e/attachment.html>
More information about the Xep-support
mailing list