Hi all,

I had the same prob in my project. I made a little
java class (based on some code i found on the
internet) that calculate the actual width of my image.
I call that class inside my xsl (thru xalan java
extension). Then, according to some rules, i configure
width="Xcm" inside external graphic tag.

Here is some example of my code :

in the header zone :

<xsl:stylesheet version="1.0"


then in my xsl rule :

<fo:block space-before="0.5cm" text-align="center"
<xsl:variable name="image">temp\images\<xsl:value-of
<!-- compute the width of my image... -->
<xsl:variable name="pWidth"
<fo:table-column column-width="{$gLargeurPapier}cm"/>
<fo:external-graphic src="{$image}" 
keep-with-next="always" width="{$pWidth}cm"/>
<fo:table-row keep-with-previous="always">
<fo:block font-family="Helvetica" font-size="12pt"
text-align="center" space-after="0.1cm"
keep-with-previous="always" space-before="0.3cm">
<xsl:if test="@titre">
Fig. <xsl:number count="ressource[@type='image']"
level="any" format="1"/> : <xsl:value-of

Hope this helps...

--- Torsten Erler <[EMAIL PROTECTED]> a écrit : > Yes
I'm using this as temporarily solution to avoid
> program crashes, but
> even the image is scaled into the specified size,
> also if it has original
> size of e.g. 10x15 pixel. This produces a unusable
> chequered print-preview.
> Is there another way to force the scaling only if
> the image overflows the
> dimension of the page body area???
> P.S.: I've tried to overwrite AWTRenderers
> "renderImageArea(ImageArea
> area)"to scale the image before painting, but it
> seems to be the loop
> occures before on formatting the area tree (I'll
> debug this step by step, to
> find the precise position).
> ThanX Torsten
> -----Original Message-----
> From: J.Pietschmann [mailto:[EMAIL PROTECTED]]
> Sent: Montag, 29. April 2002 01:21
> Subject: Re: external-graphic size
> Torsten Erler wrote:
> > I've a problem with external graphics, which can
> be greater than the page
> > size of the xsl-template. The properties
> max-height and max-width doesn't
> > work (not implemented). The result is an infinite
> loop on rendering the
> > (correctly) generated "fo"-file with the
> AWTRenderer to display the
> result.
> > Is there a workaround for that or have I omit an
> important setting
> (possible
> > in xsl) for a parent object.
> Try setting height and/or width on the
> fo:external-graphic
> element. If you specify both, the graphic may be
> stretched,
> of you specify only one, the aspect ratio is
> conserved.
> J.Pietschmann
> To unsubscribe, e-mail:
> For additional commands, email:
> To unsubscribe, e-mail:
> For additional commands, email:

Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to