The URL is fine. Are u sure that URL can point to a servlet? According to the iText documentation, it seems that URL must point to a file, eg. URL must have the extension of .jpg, .gif, .png etc, but it is not the case when pointing to a servlet.


Paulo Soares <[EMAIL PROTECTED]> wrote:
Load the URL to a byte array and look at what you got. It's probably a "404
not found" server error.

----- Original Message -----
From: "Ide Mile" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, March 29, 2005 9:30 PM
Subject: [iText-questions] Displaying an image. How to?


> I'm using Struts, but that is not so important for this question.
> I made a servlet that generates .jpg image. From my JSP I call it with:
>
>
>
> and it works fine. Image is displayed as expected.
>
> Question: Is it possible to call a servlet to generate a .jpg image using
iText? When I try something like this:
>
> doc.add(Image.getInstance(new
URL("http://localhost:8080/rezimi/dijagram.do?trenutak=3.715779497878376&cel
=4&meh=true")));
>
> I get an error:
>
> java.io.IOException:
http://localhost:8080/rezimi/dijagram.do?trenutak=3.715779497878376&cel=4&meh=true
is not a recognized imageformat.
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Small Business - Try our new resources site!


Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!

Reply via email to