evenisse 2004/01/26 00:27:41 Modified: pdf/src/plugin-resources fo-body.xslt Log: Fix the image size when attributes heigth and width aren’t defined Revision Changes Path 1.5 +22 -2 maven-plugins/pdf/src/plugin-resources/fo-body.xslt Index: fo-body.xslt =================================================================== RCS file: /home/cvs/maven-plugins/pdf/src/plugin-resources/fo-body.xslt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- fo-body.xslt 21 Jan 2004 11:47:34 -0000 1.4 +++ fo-body.xslt 26 Jan 2004 08:27:41 -0000 1.5 @@ -310,15 +310,35 @@ <xsl:variable name="height"> <xsl:value-of select="substring-before(concat(normalize-space(@height),'p'),'p') div $imageDpi"/> </xsl:variable> + <xsl:variable name="realwidth"> + <xsl:choose> + <xsl:when test="normalize-space($width) = 'NaN'"> + <xsl:value-of select="'auto'"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$width"/>in + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="realheight"> + <xsl:choose> + <xsl:when test="normalize-space($height) = 'NaN'"> + <xsl:value-of select="'auto'"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$height"/>in + </xsl:otherwise> + </xsl:choose> + </xsl:variable> <!-- Enclose image in a block if parent is a section or subsection element --> <xsl:choose> <xsl:when test="parent::section | parent::subsection"> <fo:block> - <fo:external-graphic src="{normalize-space($source)}" height="{$height}in" width="{$width}in" content-height="auto" content-width="auto"/> + <fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/> </fo:block> </xsl:when> <xsl:otherwise> - <fo:external-graphic src="{normalize-space($source)}" height="{$height}in" width="{$width}in" content-height="auto" content-width="auto"/> + <fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/> </xsl:otherwise> </xsl:choose> </xsl:template>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]