Hi all,
I want to generate a pdf with Fop with the help of velocity-servlets .
The application works fine and the the generating of pdf makes no problems, without images in the vm-file. Now, I want to add an image. No problem? A big problem for me, obviously! The application works fine again, BUT the generated pdf-file displays no image.
What's going wrong?

1. entry in servlet init()-Method
...
new Options(new File("/usr/local/tomcat/webapps/webAT/conf/userconfig.xml"));
...

2. Entry in "userconfig.xml":
 <entry>
   <key>baseDir</key>
   <value>usr/local/tomcat/webapss/webAT/templates/pdf/</value>
 </entry>

I tried a lot, like this
" <value>./webAT/templates/pdf/</value>"
or like this
"<value>/templates/pdf/</value>"
or like this
"<value>webAT</value>"
an so on


3. abs. Path to the vm-File on my testserver is
usr/local/tomcat/webapps/webAT/templates/pdf/test.vm

4. abs. Path to image
usr/local/tomcat/webapps/webAT/templates/pdf/logotr.gif --> the same directory


5. vm-File:
snip
<fo:external-graphic height="16pt" scaling="uniform" src="url('file:logotr.gif')"/>
snip

6. I'm looking in the mailing for similar problems. But all proposals to solve the problem failed.
And whatever I try, I got more than less the same error:

"Error while creating area : Invalid Image URL - error on relative URL : no protocol:

usr/local/tomcat/webapss/webAT/templates/pdf/logotr.gif"


Additionally, I tried an alternative:
servlet init()-Method :
snip
Configuration.put("baseDir", "file:" + getServletContext().getRealPath("/WebAT/templates/pdf/") );
snip
errormessage:
"Error while recovering Image Informations (file:/usr/local/tomcat/webapps/webAT/WebAT/templates/pdf/logotr.gif) : /usr/local/tomcat/webapps/webAT/WebAT/templates/pdf/logotr.gif (No such file or directory)"


further informations:
Eclipse 3.0.2
Apache Tomcat/5.0.28
FOP 0.20.5

Any idea? Have I overlooked a simple fault?
Thanks in advance
Peter

--

  FACHHOCHSCHULE KAISERSLAUTERN STANDORT ZWEIBRUECKEN
  Competence Center Instructional Design in Technology(CCIDT)
Geschäftsleitung
  Dipl.-Inf.(FH) Peter Kalsch           Amerikastrasse 1
                                        D-66482 Zweibruecken
Tel. : +49-(0)6332/914-396 eMail: [EMAIL PROTECTED] www.ccidt.de


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to