I want to display JFreeChart in PDF. I am usin gthe following snippet of code. However, it displays chart at the bottom of the page and not at the top.
I would really appreciate any help.
Thanks, Suprigya
// main function call....
Document doc = new Document();
ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
PdfWriter docWriter = null;
docWriter = PdfWriter.getInstance( doc, baosPDF ); doc.open();
addChart( docWriter,
( JFreeChart )req.getSession().getAttribute( "9001" ) );
// addChartFunction int width = 300; int height = 200; PdfContentByte cb = docWriter.getDirectContent(); PdfTemplate tp = cb.createTemplate( width, height ); Graphics2D g2 = tp.createGraphics( width, height, new DefaultFontMapper() ); Rectangle2D r2D = new Rectangle2D.Double( 0, 0, width, height ); chart.draw( g2, r2D, null ); g2.dispose(); cb.addTemplate( tp, 0, 0 );
_________________________________________________________________
MSN Shopping upgraded for the holidays! Snappier product search... http://shopping.msn.com
------------------------------------------------------- This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/ _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
