setTotalWidth() does nothing if used with Document.add(PdfPTable). Use setWidthPercentage() instead. Next version has the option of also using absolute values in this case.
Best Regards, Paulo Soares > -----Original Message----- > From: Sridhar [SMTP:[EMAIL PROTECTED] > Sent: Friday, March 21, 2003 12:02 > To: [EMAIL PROTECTED] > Subject: [iText-questions] Setting the width of pdfptable in JSP > > Hi > > How to set the width of the PdfPTable in JSP. When I use > pdfptable.setTotalWidth(500); its working fine when I execute the > example.. but whereas when I use this in my JSP the width is not setting > the width is always fixed though I increase or decrease.. could you plz > help me in this. > > PdfPTable pdfptable = new PdfPTable(5); > // MyTableEvent event = new MyTableEvent(); > // pdfptable.setTableEvent(event); > pdfptable.setTotalWidth(500); > pdfptable.getDefaultCell().setBorder(Rectangle.NO_BORDER); > > PdfPCell pdfpcell = new PdfPCell(new Phrase("Column 1",fonts[1])); > pdfptable.addCell(pdfpcell); > pdfpcell = new PdfPCell(new Phrase("Column 2",fonts[1])); > pdfptable.addCell(pdfpcell); > pdfpcell = new PdfPCell(new Phrase("Column 3",fonts[1])); > pdfptable.addCell(pdfpcell); > pdfpcell = new PdfPCell(new Phrase("Column 4",fonts[1])); > pdfptable.addCell(pdfpcell); > pdfpcell = new PdfPCell(new Phrase("Column 5",fonts[1])); > pdfptable.addCell(pdfpcell); > document.add(pdfptable); > > Thanks > > Sridhar > > > > > > _____ > > Do you Yahoo!? > Yahoo! Platinum > <http://rd.yahoo.com/platinum/evt=8162/*http://platinum.yahoo.com/splash.h > tml> - Watch CBS' NCAA March Madness, live on your desktop > <http://rd.yahoo.com/platinum/evt=8162/*http://platinum.yahoo.com/splash.h > tml>! ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions