content-width and -height are not supported for FOP 0.20.5, as seen on this page
http://xmlgraphics.apache.org/fop/compliance.html#fo-property-content-width
and yes, width / height are the way to go...but not both at the same time since that would destroy the aspect ratio of your images, if I recall correctly.
Marco
2006/7/20, Andrew Stevens <
[EMAIL PROTECTED]>:
>From: "Omar Adobati" < [EMAIL PROTECTED]>
>Date: Thu, 20 Jul 2006 10:40:09 +0200
>
>Good Morning,
>
> What is the reason I need to use the full path of an image I want to
>display into a PDF generated file?
I believe it's a limitation of Apache FOP. I was recently working on a
(non-Cocoon) servlet that used XSL/FOP to generate a PDF, and had to use the
full URLs in that also.
>This way to use images kills
>portability, Not always the code one develop will runs on the same
>machine he use to write the code...
I worked around that by passing in the host/port/context (read from the
request object) as a parameter to the XSL transformation. You could do much
the same with Cocoon using something like
<map:transform type="xsl" src=""> <map:parameter name="baseUrl"
value="http://{request:serverName}:{request:serverPort}{request:contextPath}"/>
in your sitemap and
<xsl:param name="baseUrl"/>
...
<fo:external-graphic src=""
in the XSLT stylesheet. This avoids having to hard code the server in your
XSL.
>And, more, how to resize the image? I have tried to use content-height
>and content-weight attributes, but they seems to not work... any
>suggestion (I know I could resize it with an image editor software,
>but I'd like to not do this for many reasons).
I can't remember how I ended up that way, but nearly all the
external-graphic elements in my XSL were using both width and content-width
attributes (I let it scale the height automatically to preserve the aspect
ration). I have a feeling that when I only used content-width it didn't
work, or maybe it was the other way round. The other external-graphic in
that file has only a height attribute, so perhaps it's height and width that
are needed to get it to work properly rather than content-height &
content-width?
Andrew.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
