[xep-support] viewBox with rotated SVG

Stijn Elst stijn at fotek.com
Mon Apr 3 04:00:21 PDT 2006


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/20060403/27546665/attachment.html>


More information about the Xep-support mailing list