if you want to put an image on your pdf, you have to do something like this:

 String path = request.getContextPath();
                String split_path[] = path.split("/");
                path = request.getRealPath(split_path[0]);
                 String nof="\\WEB-INF\\RESOURCES\logo.gif";
       
                Image jpeg=null;
                try
                {
                jpeg = Image.getInstance(path+nof);
                jpeg.setAlignment(Image.LEFT);

                doc.add(jpeg);
                }
                catch(Exception e) { System.out.println(e);}

Bruno Lowagie <[EMAIL PROTECTED]> wrote: Kristof Taveirne wrote:
> Hi,
>
> I’m having some problems loading an image from my /images folder of my 
> web application into the pdf. 
> Where is iText is looking for the image when I try
> logo = Image.getInstance("logo.jpg");
> It didn’t even work when I did
> logo = Image.getInstance("http://localhost:8080/MyProject/images/logo.jpg";);
> Any ideas ?

Can you open the file logo.jpg using nothing more
than java.io.* classes? I'm 99% sure the problem
is not iText related.

> It’s the only line of code that is keeping me from finishing this project J

We have the same employer (at least as long as the
decision to move to SAP Campus Management isn't final).
Ik zit op DICT, maar ik kan gerust eens op mijn fiets
springen en naar het technicum komen om te helpen.

best regards,
Bruno

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


       
---------------------------------
Shape Yahoo! in your own image.  Join our Network Research Panel today!
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to