On Oct 15, 2004, at 7:15 AM, Dionisio Ruiz de Zárate wrote:
using this code it return well the graphic into the pdf file:
<fo:external-graphic border-after-color="#013A6C" border-before-color="#013A6C" border-end-color="#013A6C" border-start-color="#013A6C" color="#013a6c" content-height="80px" content-width="85px" font-size="45px" height="80px" text-align="right" width="85px" space-before.optimum="4pt" space-after.optimum="4pt">
<xsl:attribute name="src">url(' <xsl:text disable-output-escaping="yes">C:\html\pdf\certificadosCursos/ certLogo.gif</xsl:text> ') </xsl:attribute>
</fo:external-graphic>
but i will pass to one linux machine and the image will be into the webapp root dir (/) and pdf/certificadosCursos/certLogo.gif
but if i use:
<xsl:attribute name="src">url(' <xsl:text disable-output-escaping="yes">/pdf/certificadosCursos/certLogo.gif</ xsl:text> ') </xsl:attribute>
it doesn't return the file (the graphic).
how can i solve this problem without use the absolute path (/home/user/html/........)?
is posible to load the imagen with une url (http://www.domain.com/pdf/certificadosCursos/certLogo.gif
?? thnaks
A couple of things:
I don't think you need to use the <xsl:text disable0output-escaping.../> stuff. It should be fine to use
<fo:external-graphic border-after-color="#013A6C" border-before-color="#013A6C" border-end-color="#013A6C" border-start-color="#013A6C" color="#013a6c" content-height="80px" content-width="85px" font-size="45px" height="80px" text-align="right" width="85px" space-before.optimum="4pt" space-after.optimum="4pt">
<xsl:attribute name="src">url('/pdf/certificadosCursos/certLogo.gif')</xsl:attribute>
</fo:external-graphic>
or
<fo:external-graphic border-after-color="#013A6C" border-before-color="#013A6C" border-end-color="#013A6C" border-start-color="#013A6C" color="#013a6c" content-height="80px" content-width="85px" font-size="45px" height="80px" text-align="right" width="85px" space-before.optimum="4pt" space-after.optimum="4pt" src="url('/pdf/certificadosCursos/certLogo.gif')"/>
Some other tips: - You can use shorthand for border-color - color, font-size, & text-align are unnecessary - content-height & content-width are not implemented
So boil it all down, and you can use this:
<fo:external-graphic border-color="#013A6C" height="80px" width="85px" space-before.optimum="4pt" space-after.optimum="4pt" src="url('/pdf/certificadosCursos/certLogo.gif')"/>
This should work on the linux box. One other thing you could to, is use a variable for the IMAGE_DIRECTORY then set the variable for each machine:
(NOTE: xsl:variable elements must go near the top of <xsl:stylesheet/> element, under xsl:include elements, but before xsl:template Search the web for more info)
PC XSL-FO:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- varImagesDirectory | value used to set images/ directory on different machines -->
<xsl:variable name="varImagesDirectory">C:\html\pdf\certificadosCursos</xsl:variable>
Linux XSL-FO:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- varImagesDirectory | value used to set images/ directory on different machines -->
<xsl:variable name="varImagesDirectory">/pdf/certificadosCursos</xsl:variable>
<fo:external-graphic border-color="#013A6C" height="80px" width="85px" space-before.optimum="4pt" space-after.optimum="4pt" src="url('{$varImagesDirectory}/certLogo.gif')"/>
Hope this helps!
Web Maestro Clay -- Clay Leeds - <[EMAIL PROTECTED]> Webmaster/Developer - Medata, Inc. - <http://www.medata.com/> PGP Public Key: <https://mail.medata.com/pgp/cleeds.asc>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]