That's documented behavior. See the javadoc for PdfPTable.

Best Regards,
Paulo Soares

> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]
> Sent: Friday, October 24, 2003 16:46
> To:   [EMAIL PROTECTED]
> Subject:      [iText-questions] PdfPTable- Large Cell throws IOException
> 
> 
> Hi, I'm using PdfPTable, when a cell is too large--more than a page,
> throws an exception like this: 
> ExceptionConverter: java.io.IOException: The document has no pages. 
>         at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source) 
>         at com.lowagie.text.pdf.PdfWriter.close(Unknown Source) 
>         at com.lowagie.text.pdf.PdfDocument.close(Unknown Source) 
>         at com.lowagie.text.Document.close(Unknown Source) 
>         at com.gsk.harp.util.PdfTest.main(PdfTest.java:65) 
> Exception in thread "main" 
> 
> My program is as below: 
> 
> public class PdfTest { 
>   public static void main(String[] args) { 
> 
>         Document document = new Document(PageSize.A4.rotate(), 36, 36, 36,
> 36); 
>     try { 
> 
>       PdfWriter writer = 
>         PdfWriter.getInstance( 
>           document, 
>           new FileOutputStream("C:\\doc\\BaseDoc1.pdf")); 
> 
>       document.open(); 
>           PdfPTable table = new PdfPTable(3); 
>           table.addCell("test1"); 
> 
>         //add a large cell 
>           StringBuffer sb = new StringBuffer(); 
>           for(int i=0; i<50; i++) { 
>            sb.append("testtest\n"); 
>           } 
>           table.addCell(sb.toString()); 
> 
>         //add a large nested table 
>           PdfPTable table1 = new PdfPTable(1); 
>           for(int i=0; i<30; i++) {           
>            table1.addCell("test3"); 
>           } 
>           PdfPCell pcell = new PdfPCell(table1); 
>           pcell.setPadding(0.0f); 
>           table.addCell(pcell); 
>           document.add(table); 
> 
>     } catch (DocumentException de) { 
>       System.err.println(de.getMessage()); 
>     } catch (IOException ioe) { 
>       System.err.println(ioe.getMessage()); 
>     } 
> 
>     // step 5: we close the document 
>     document.close(); 
>   } 
> 
> }


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to