James Turner wrote:

>Hi there,
>   I need to create charts inline in the document (not as separate
>documents).  I've looked at the JFreeCharts example, and it won't work for
>me for two reasons.  First off, it creates a separate document.  
>
Not necessarily.
It only creates a separate document if you code it that way.
You can easily add a JFreeCharts chart to a PdfGraphics2D object
that writes to a PdfTemplate object. You can wrap this PdfTemplate
object in a com.lowagie.text.Image object and add it to a PDF document.

>Secondly,
>it seems specific to the PdfWriter, and I need a solution that will also
>work for RTF (and HTML.)
>  
>
The com.lowagie.text.Image objects is PDF only.
It contains a sequence of PDF syntax that can not be understood
by an RTF and/or HTML interpreter.
You need to tell JFreeChart to create an image format
that can be used in RTF/HTML (PNG, GIF, JPEG,...)

>   I've tried creating an image using JFreeChart directly and inserting it,
>but it look cruddy, with fuzzy fonts.
>
That sounds like you are generating a JPEG.
JPEG is a very good format for photographs,
but you need a format that is suited for vector images.
I don't know JFreeChart that well, but can't you generate
a PNG or a GIF instead of a JPEG?

>Image image = Image.getInstance(EncoderUtil.encode(ch, ImageFormat.PNG));
>  
>
Oh I see, you ARE creating a PNG.
Then maybe it's a resolution problem.
This is a question for the JFreeChart people
rather than for the iText mailing list.
br,
Bruno


_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to