Subject: Re: Problem with PdfPTable! 2007-11-06 - By Bruno Lowagie (iText)
Back Eric Summkeller wrote: > I create a PdfPTable with only one PdfPCell and set the header row number to > one. My problem is, that no PdfPTable appears in the document. I only get an > exception that the document has no pages. The problem is, till the creation of > the table I don't know how big the table will be and set this header row per > default to one. > > Code example to reconstruct my problem: > > document.open(); > PdfPTable table = new PdfPTable(1); > table.setHeaderRows(1); > PdfPCell cell = new PdfPCell(new Phrase("Test")); > table.addCell(cell); > document.add(table);
The table has a header (setHeaderRow(1)), but no content. You should either add extra content (besides the header) or, if you only have one row, not define that single row as being a header row (that doesn't really make sense).
br, Bruno
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
|
|