Thanks Bruno. Another Q, how do I print this Graphics2D? I think I cannot do jTable2.print(g2).
Agarwal, Sunil [CIB-IT] wrote: > Is this the example you are referring to? Yes, that's the one. But as you'll be working with Graphics2D, you'll need to do something like this: PdfContentByte cb = writer.getDirectContent(); PdfTemplate map = cb.createTemplate(w, h); Graphics2D g2d = map.createGraphics(w, h, new DefaultFontMapper()); br, Bruno -----Original Message----- From: Bruno Lowagie (iText) [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 21, 2007 4:42 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Jtable2PDF: missing column names and pagination Agarwal, Sunil [CIB-IT] wrote: > Q1: My Jtable is fairly big, meaning spans multiple pages. But I can > see only the first page in generated PDF. You create a rectangle of 1100 x 1400 points. I assume your JTable is bigger. In that case I wouldn't write the JTable to the writer.getDirectContent(), but to a PdfTemplate that has the correct size (bigger than 1100 x 1400 pt). Then I would add the template to different pages as I explained a couple of weeks ago (sorry, I'm too lazy right now to search for the example). > Q2: Can any one suggest a way to generate table header? I don't know if this is a JTable question or an iText question. If it's a JTable question: I don't think it's difficult; it's probably somewhere in the Swing tutorial. If it's an iText question: one you have the JTable in a PdfTemplate object, I suggest that you add all content at absolute positions: a header with showTextAligned or ColumnText; the PdfTemplate with addTemplate and the correct offset. br, Bruno PS: this question was sent to me personally with [iText-questions] in the Subject line. This is confusing. Please sent questions to the list. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
