Discussion:
[iText-questions] strange exception regarding table width
Marc Lustig
2003-07-28 08:48:03 UTC
Permalink
Strangely, the method below always generates this Exception:

ExceptionConverter: java.lang.RuntimeException: The table width must be
greater than zero.

I've explicitly set the width. What's wrong?


public void onEndPage(PdfWriter writer, Document doc) {
PdfPTable table = new PdfPTable(2);
table.setWidthPercentage(100);
table.addCell(new PdfPCell(new Phrase("test1")));
table.addCell("test2");

table.writeSelectedRows(0, -1, 1, Util.toPts(200),
writer.getDirectContentUnder());
}
Paulo Soares
2003-07-28 09:10:22 UTC
Permalink
You must set setTotalWidth.

Best Regards,
Paulo Soares

----- Original Message -----
From: "Marc Lustig" <***@marclustig.com>
To: "iText list" <itext-***@lists.sourceforge.net>
Sent: Monday, July 28, 2003 11:48
Subject: [iText-questions] strange exception regarding table width
Post by Marc Lustig
ExceptionConverter: java.lang.RuntimeException: The table width must be
greater than zero.
I've explicitly set the width. What's wrong?
public void onEndPage(PdfWriter writer, Document doc) {
PdfPTable table = new PdfPTable(2);
table.setWidthPercentage(100);
table.addCell(new PdfPCell(new Phrase("test1")));
table.addCell("test2");
table.writeSelectedRows(0, -1, 1, Util.toPts(200),
writer.getDirectContentUnder());
}
-------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/itext-questions
Continue reading on narkive:
Loading...