Fw: [xep-support] viewBox with rotated SVG

From: Stijn Elst <stijn@fotek.com>
Date: Tue Apr 04 2006 - 08:12:31 PDT

Never mind, it's fairly easy when you rotate AND translate...

----- Original Message -----
From: Stijn Elst
To: xep-support@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.

-------------------
(*) 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 Tue Apr 4 08:43:55 2006

This archive was generated by hypermail 2.1.8 : Tue Apr 04 2006 - 08:43:58 PDT