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 Jasmin Mehta <jm...@mdnotes.com> on 2003/01/09 21:01:43 UTC

problem in FOP for locating image with relative path THOUGH have used BaseDir

Hi,
 
In context of my below email, I have also tried with setting base dir
from the servlet by writing below line in servlet:
 
 
org.apache.fop.configuration.Configuration.put("baseDir","http://localho
st:8100/LDNotes/doctor/");
 
and change my xsl-fo code like below: (just specifying image file name
in source attribute as a relative path)
 
<fo:block text-align="center" start-indent = "10.0cm">
            <fo:external-graphic>
                 <xsl:attribute name="src"><xsl:value-of
select="Dictator_Signature"/></xsl:attribute>
</fo:external-graphic>
              </fo:block>
But still I'm getting below error:
 
[ERROR] Could not load external SVG: The current document is unable to
create an
 element of the requested type (namespace: http://www.w3.org/2000/svg,
name: hea
d).
[ERROR] Error while creating area : No ImageReader for this type of
image (http:
//localhost:8100/MDNotes/doctor/signature.gif)
 
Now, if I change my xsl-fo file again as below (give full path where the
file is located in local system)
 
<xsl:attribute
name="src">C:\\JRun4\\servers\\default\\MDNotes\\phySignatures\\<xsl:val
ue-of select="Dictator_Signature"/></xsl:attribute>
 
than it works fine.
 
Can anybody pl focus on who to solve this problem
 
Thanks
Jasmin
 
 
 
-----Original Message-----
From: Jasmin Mehta 
Sent: Thursday, January 09, 2003 12:27 PM
To: 'fop-user@xml.apache.org'
Subject: problem in FOP for locating image with relative path
 
Hi,
 
I want to add image in the PDF file. I'm using below tag in my xsl-fo
file
 
<fo:block text-align="center" start-indent = "10.0cm">
 
            <fo:external-graphic>
 
                 <xsl:attribute
name="src">C:/JRun4/servers/default/LDNotes/doctor/<xsl:value-of
select="Dictator_Signature"/></xsl:attribute>
 
     
 
                </fo:external-graphic>
 
              </fo:block>
 
 
 
and it works fine. But a I want to use this xsl-fo file in my JSP, I
want to give a relative path for this image source. For example the JSP
that has link to open this PDF file using xsl-fo has
url=http://localhost:8100/LDNotes/doctor/ShowAllFinalDocs.jsp and my all
images to display are located in /LDNotes/doctor/ folder at default
server directory of JRun.
 
 
Now, if I write the tag like below:
 
 
<xsl:attribute name="src">./../doctor/<xsl:value-of
select="Dictator_Signature"/></xsl:attribute>
 
 
 
I'm getting below error and image is not displaying.
 
 
 
[ERROR] Error while creating area : Error with image URL:
.\..\doctor\signature.gif (The system cannot find the path specified)
and no base directory is specified.
 
Can somebody suggest me what path can I use here?
 
I also don't know how to set the base directory. My server url can be
http://localhost:8100/LDNotes/doctor while I will access the .xsl file
from the servlet.
 
Thanks
 
Jasmin
 
 

Re: problem in FOP for locating image with relative path THOUGH have used BaseDir

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jasmin Mehta wrote:
> But still I’m getting below error:
> [ERROR] Could not load external SVG: The current document is unable to 
> create an
>  element of the requested type (namespace: http://www.w3.org/2000/svg, 
> name: head).
> 
> [ERROR] Error while creating area : No ImageReader for this type of 
> image (http://localhost:8100/MDNotes/doctor/signature.gif)

Guess: You have a local web server running which can't do anything
with the URL you asked FOP do download from it and returns an oddly
formed error message.

What do you see if you point your browser to
http://localhost:8100/MDNotes/doctor/signature.gif
(or whatever)

You could also look into the FOP FAQ for further hints
  http://xml.apache.org/fop/faq.html#faq-N10251

However, the data you gave is inconsistent with the error messages.
I suggest seeking local help for writing proper problem reports,
writing in english and probably also for teaching the difference
between an URL and a directory and other basics.

J.Pietschmann


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