Thanks Paolo for your quick response, It works!
-------- David -----Mensaje original----- De: Paulo Soares [mailto:[EMAIL PROTECTED] Enviado el: mi�rcoles, 06 de agosto de 2003 12:13 Para: Carmona Perez, David; Itext-Questions (E-mail) Asunto: RE: [iText-questions] PdfPTable width > -----Original Message----- > From: Carmona Perez, David [SMTP:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2003 10:55 > To: Itext-Questions (E-mail) > Subject: [iText-questions] PdfPTable width > > Hi all, > > I create the following table in this way (I want to occupy the full width > of the page): > > PdfPTable tbl = new PdfPTable(2); > float width = doc.right()-doc.left(); > float myColumnWidth = 20f; > tbl.setWidths(new float[] { width - myColumnWidth, > myColumnWidth } ); > tbl.setTotalWidth(width); > document.add(tbl); > > Surprisingly it occupies about 80% of the total width. > setTotalWidth() does nothing with document.add(). You need setWidthPercentage(). Best Regards, Paulo Soares > > If I do the following: > > PdfContentByte cb = writer.getDirectContent(); > cb.setColorStroke(Color.yellow); > cb.rectangle(doc.left(), doc.top()-50*fc, > doc.right()-doc.left(), 50*fc); > cb.stroke(); > > The rectangle drawn is wider than the table > > On the other hand if I draw the table with > > tbl.writeSelectedRows(0, -1, document.left(), y, > writer.getDirectContent()); > > it occupies the full width. > > Any idea of what is happening will be greatly appreciated > > -------- > David > ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
