G
Grand Paradis
I would like to add a JFreeChart into a PDF document, using jfreechart
and itext libraries, but my chart isn't clean. When I add it into an
HTML page, it's beautiful, but into a PDF it's very ugly (text of
title and categories is too big and not thin enough)
Here is my code :
private void writeChart (JFreeChart chart, int width, int height,
PdfContentByte cb) {
PdfTemplate tp = cb.createTemplate(width, height);
Graphics2D g2 = tp.createGraphics(width, height, new
DefaultFontMapper());
Rectangle2D r2 = new Rectangle2D.Double(0, 0, width, height);
chart.draw(g2, r2);
g2.dispose();
cb.addTemplate(tp, 100, 550);
}
Do you know what I should do?
Thanks
and itext libraries, but my chart isn't clean. When I add it into an
HTML page, it's beautiful, but into a PDF it's very ugly (text of
title and categories is too big and not thin enough)
Here is my code :
private void writeChart (JFreeChart chart, int width, int height,
PdfContentByte cb) {
PdfTemplate tp = cb.createTemplate(width, height);
Graphics2D g2 = tp.createGraphics(width, height, new
DefaultFontMapper());
Rectangle2D r2 = new Rectangle2D.Double(0, 0, width, height);
chart.draw(g2, r2);
g2.dispose();
cb.addTemplate(tp, 100, 550);
}
Do you know what I should do?
Thanks