Marc Lustig
2003-07-28 08:48:03 UTC
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());
}
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());
}