A couple of thoughts:
1) Front iText with Flying Saucer XHTML renderer
2) Inline the image with data:URI.

Good luck.



jmcmahon wrote:
> 
> I am trying use the  http://www.jfree.org/eastwood/index.html Eastwood
> Chart Servlet , which is based off the  http://code.google.com/apis/chart/
> Google Chart Api , with iText. Essentially you send a formatted url string
> off to the servlet and it returns a .png image of the chart. This works
> great for html pages, but now I am trying embed the chart urls as images
> in iText without much success. For example:
> 
>                 Image img = Image.getInstance(testUrl);
> 
> Where testUrl is a String or URL (I've tried both and if you look at the
> code they are essentially the same thing).
> 
> This results in this error:
> 
> java.io.IOException: Server returned HTTP response code: 406 for URL: 
> testUrl
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1170)
>         at java.net.URL.openStream(URL.java:1007)
>         at com.lowagie.text.Image.getInstance(Unknown Source)
>         at com.lowagie.text.Image.getInstance(Unknown Source)
> 
> That is just the top of the stack trace, as the rest is program specific.
> testUrl is a stand-in for the actual url.
> I took a look at the HTTP header with snort and it looks like this:
> 
> testUrl HTTP/1.1..User-Agent: Java/1.5.0_14..Host:
> devjrun..Accept:text/html, image/gif, image/jpeg, *; q=.2,
> */*;q=.2..Proxy-Connection: keep-alive....
> 
> This returns a 406 not accepted from the server with a message "Your
> request used a protocol that is not currently supported."
> 
> Essential I've hit a wall and I have no idea about how to get this to
> work. Any ideas/suggestions would be greatly welcome.
> 
> Thanks.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-Goolge-Chart-Api-or-Eastwood-in-iText-tp15859998p16099777.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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