cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <>
Subject RE: PDF: external-graphic & absolute path
Date Fri, 21 Jul 2006 09:23:00 GMT

> 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="whatever.xsl">
>    <map:parameter name="baseUrl" 
> value="http://{request:serverName}:{request:serverPort}{reques
> t:contextPath}"/>
> in your sitemap and
> <xsl:param name="baseUrl"/>
> ...
> <fo:external-graphic src="{$baseUrl}/images/my_logo.png"/>
> in the XSLT stylesheet.  This avoids having to hard code the 
> server in your 
> XSL.

We normally also solve it this way, but watch out for one thing above: Normally, your cocoon
app will run on a server listening to a certain port, with apache httpd in front. Now, this
means that when it is working on your local cocoon app on a certain port, and you deploy it,
you might and up with external graphics with a port number in it. Normally, you don't want
people to access your cocoon app directly. Make sure that in deployment, the port number is
the one httpd (or what you are using) listens to


> >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:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message