[xep-support] viewBox with rotated SVG

From: Stijn Elst <stijn@fotek.com>
Date: Mon Apr 03 2006 - 04:00:21 PDT

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.

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Mon Apr 3 04:29:30 2006

This archive was generated by hypermail 2.1.8 : Mon Apr 03 2006 - 04:29:34 PDT