I have a PDF document with a chart in it. The chart is generated by JFreeChart and is added to the document with the code below. With iText version 1.00, the resulting PDF looks excelent, but with iText 1.02b, the chart in the generated PDF doesn't look as good as with version 1.00 . More in specific, the displayed font in 1.02b is not as sharp as in version 1.00 .
I've put 2 generated PDF documents here: with iText 1.00: http://www.qmedit.com/temp/chart-1.00.pdf with iText 1.02b: http://www.qmedit.com/temp/chart-1.02b.pdf
any idea what could be wrong ?
thanks, Maarten
Here is the piece of code that adds the JFreeChart:
Document doc = ...; JFreeChart chart = ...;
DefaultFontMapper mapper = new DefaultFontMapper(); PdfContentByte cb = writer.getDirectContent(); PdfTemplate tp = cb.createTemplate(width, height); Graphics2D g2 = tp.createGraphics(width, height, mapper); Rectangle2D r2D = new Rectangle2D.Float(0, 0, width, height);
chart.draw(g2, r2D); g2.dispose(); Image img = Image.getInstance(tp);
/* * we put the graph in a table so it is automatically placed on * a new page if it doesn't fit on the current one */ PdfPTable graphTable = new PdfPTable(1); graphTable.setWidthPercentage(100); PdfPCell cell = new PdfPCell(img); cell.setBorderWidth(0); graphTable.addCell(cell); graphTable.setHorizontalAlignment(Element.ALIGN_LEFT); doc.add(graphTable);
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
