Adding a Image or JFreeChart to an iText pdf

I created a JFreeChart, that I can view with a servlet, and I have saved the image.

ChartUtilities.saveChartAsJPEG(new File("chart.jpg"), jcb.renderChart("time", "", resID), 650, 350);

...

Image jpg = Image.getInstance(new URL("http://localhost:8080/myApp/chart.jpg"));

doc.add(jpg);

I have verified that the image is at the URL specified. When I render the report, there is no exception, and there is no image in my pdf. I have tried adding the image to a cell and then the cell to a table and then the table to the document, but that does not work.

Best case I would like the to add the JFreeChart directly to the pdf, but I didn't have any luck doing it like this -

BufferedImage bi = jcb.renderChart("time", "", resID).createBufferedImage(650,350);

Image jpg = Image.getInstance(bi, null);

But nothing rendered on my pdf and I didn't get an exception.

[923 byte] By [psurossa] at [2007-10-2 13:10:33]
# 1
You know about the sample programs right? http://itextdocs.lowagie.com/tutorial/objects/images/index.htmlI had little trouble adding images to the PDF, but then again I added images from disk.
gimbal2a at 2007-7-13 10:37:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...