I'm a bit confused, the whole reason I'm using iText is so that I can produce RTF, HTML and PDF from the same code. Are you saying that no matter how I insert the chart into the Document (PNG image from JFreeChart or Jfree directly into a PdfGraphics2D), it won't work with the RtfWriter? *sigh*. I've really been trying to avoid having to have separate solutions for generating my reports in different formats. I tried JasperReports, but it's pretty clueless about doing anything but a single query per document.
James Turner [EMAIL PROTECTED] 603-552-2020 Freelance Technology Journalist Senior Contributing Editor, Linux Planet > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Bruno Lowagie > Sent: Monday, June 05, 2006 3:45 AM > To: Post all your questions about iText here > Subject: Re: [iText-questions] Good looking embedded charts? > > 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 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
