Hi

In the example below the method fitsPage() seems not
to work correctly. Has anyone an idea why fitsPage
still returns true even end of page is already
reached?

Best regards 
Markus


Font arial7=FontFactory.getFont("Arial",
BaseFont.WINANSI, 7);

Document document=new Document(PageSize.A4, 83, 10,
13, 20);

PdfWriter writer=PdfWriter.getInstance(document, new
FileOutputStream("myTable.pdf"));  

document.open();

Chunk ch = new Chunk("My Header ......");
Paragraph p=new Paragraph(30f);


p.add(ch);

document.add(p);

Table datatable=new Table(1);
datatable.setTableFitsPage(true);

for (int i=0; i<80; i++)
{
  datatable.addCell(new Phrase("Cell "+i, arial7));
  if( !writer.fitsPage(datatable))
  {
    datatable.deleteLastRow();
    break;
  }
}
document.add(datatable);
document.close();




        
                
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: 
http://mail.yahoo.de

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to