hi to all

i new in itext, so how i can add more than one chart (from JFreeChart) with
iText, i have this code and for everytime i have one more chart i call this
function

        public void chartToPdf(JFreeChart chart){
                try{
                        document.open();
                        PdfContentByte cb = writer.getDirectContent();
                        PdfTemplate tp = cb.createTemplate(width, height);
                        Graphics2D g2d = tp.createGraphics(width, height, new
DefaultFontMapper());

                        Rectangle2D r2d = new 
Rectangle2D.Double(x,y,width,height);
                        chart.draw(g2d, r2d);
                        g2d.dispose();
                        cb.addTemplate(tp, x, y);

                        document.newPage();
                        writer.setPageEmpty(false);
                        document.close();
                        
                }catch(Exception e){ e.printStackTrace();}
        }

but in the end it doesnt write in the file?
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Adding-more-than-one-JfreeChart-with-itext-tp2271191p2271191.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to