You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Miren Urkijo <mi...@tinieblas.com> on 2006/01/12 21:57:37 UTC

problem addin one image.SOS

Hello.
I have one great problem for loading images into one pdf file.
 I have made one servlet for creating pdf files, i use one xml and one xsl to produce one pdf file from my servlet.
i have one great problem with the images.
the structure of my proyect is:

/images/myimage.jpg
/WEB-INF/clases/com.midomain.servlets.myPDFConverterServlet
/WEB-INF/xsl/xslfile.xsl

executing my servlet i load one xml string and using the xsl file i produce one pdf file but without images.
for loading the image i put this into the xsl file:

<xsl:attribute name="src">url('<xsl:text disable-output-escaping="yes">myimage.jpg</xsl:text>')</xsl:attribute>
or:
<fo:external-graphic src="url('myimage.jpg')"/>
but the image doesn't appears.
i cannot put the absolute path into the server (/home/user/.............. or c:/tomcat/webapps/mydomain/images........)because i don't know the path
i think that i can to load the image with one uri or relative path.
is posible?
how?

using i have directori structure:
/images/myimage.jpg
/WEB-INF/clases/com.midomain.servlets.myPDFConverterServlet
/WEB-INF/xsl/xslfile.xsl

how must i to use the xsl for loading the image?

thanks

Re: problem addin one image.SOS

Posted by Manuel Mall <ma...@apache.org>.
>> Hello.
>> I have one great problem for loading images into one pdf file.
>>  I have made one servlet for creating pdf files, i use one xml and one
>> xsl to produce one pdf file from my servlet.
>> i have one great problem with the images.
>> the structure of my proyect is:
>>
>> /images/myimage.jpg
>> /WEB-INF/clases/com.midomain.servlets.myPDFConverterServlet
>> /WEB-INF/xsl/xslfile.xsl
>>
>
> You didn't say which version of FOP you are using. Assuming its 0.20.5
> check
> http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#config-internal
> and see if you can set the base directory (the path against which fop
> resolves relative URLs) programatically. Normally your servlet container
> can tell you the absolute path to your servlet context:
> getRealPath(java.lang.String path). Check the servlet API spec.
>
> Alternatively, just experiment... try '../../myimage.jpg' for example.

Sorry meant '../../images/myimage.jpg'

>
>> executing my servlet i load one xml string and using the xsl file i
>> produce one pdf file but without images.
>> for loading the image i put this into the xsl file:
>>
>> <xsl:attribute name="src">url('<xsl:text
>> disable-output-escaping="yes">myimage.jpg</xsl:text>')</xsl:attribute>
>> or:
>> <fo:external-graphic src="url('myimage.jpg')"/>
>> but the image doesn't appears.
>> i cannot put the absolute path into the server
>> (/home/user/.............. or
>> c:/tomcat/webapps/mydomain/images........)because i don't know the path
>> i think that i can to load the image with one uri or relative path.
>> is posible?
>> how?
>>
>> using i have directori structure:
>> /images/myimage.jpg
>> /WEB-INF/clases/com.midomain.servlets.myPDFConverterServlet
>> /WEB-INF/xsl/xslfile.xsl
>>
>> how must i to use the xsl for loading the image?
>>
>> thanks
>>
>
> Manuel
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: problem addin one image.SOS

Posted by Manuel Mall <ma...@apache.org>.
> Hello.
> I have one great problem for loading images into one pdf file.
>  I have made one servlet for creating pdf files, i use one xml and one
> xsl to produce one pdf file from my servlet.
> i have one great problem with the images.
> the structure of my proyect is:
>
> /images/myimage.jpg
> /WEB-INF/clases/com.midomain.servlets.myPDFConverterServlet
> /WEB-INF/xsl/xslfile.xsl
>

You didn't say which version of FOP you are using. Assuming its 0.20.5
check
http://xmlgraphics.apache.org/fop/0.20.5/embedding.html#config-internal
and see if you can set the base directory (the path against which fop
resolves relative URLs) programatically. Normally your servlet container
can tell you the absolute path to your servlet context:
getRealPath(java.lang.String path). Check the servlet API spec.

Alternatively, just experiment... try '../../myimage.jpg' for example.

> executing my servlet i load one xml string and using the xsl file i
> produce one pdf file but without images.
> for loading the image i put this into the xsl file:
>
> <xsl:attribute name="src">url('<xsl:text
> disable-output-escaping="yes">myimage.jpg</xsl:text>')</xsl:attribute>
> or:
> <fo:external-graphic src="url('myimage.jpg')"/>
> but the image doesn't appears.
> i cannot put the absolute path into the server
> (/home/user/.............. or
> c:/tomcat/webapps/mydomain/images........)because i don't know the path
> i think that i can to load the image with one uri or relative path.
> is posible?
> how?
>
> using i have directori structure:
> /images/myimage.jpg
> /WEB-INF/clases/com.midomain.servlets.myPDFConverterServlet
> /WEB-INF/xsl/xslfile.xsl
>
> how must i to use the xsl for loading the image?
>
> thanks
>

Manuel



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org