如果是 iTextSharp 4 的话,设置表格的 
pdfTable.CellsFitPage = false;就可以让单元格跨页显示,单元格跨页了不至于产生,第一行显示一行,而第二行在当页显示不下时,第一页就只会显示第一行的很少的内容。

解决方案 »

  1.   

    table.SplitLate = false;
    table.SplitRows = false;
      

  2.   


    看起来是这么个意思,可以我设置了这两个属性为 false 也不行啊,第一页还只是显示了一小行记录。
      

  3.   

    我是看java版的手册上说有这么两个属性,原来没用啊?
      

  4.   

    要这样
                pdfTable.SplitLate = false;
                pdfTable.SplitRows = true;You should add the table to the document using Document.Add() if you want automatic splitting of the rows across pages. Then SplitLate and SplitRows will work as expected.When SplitLate = true (default) the table will be split before the next row that does fit on the page. When SplitLate = false the row that does not fully fit on the page will be split. When SplitRows = true (default) the row that does not fit on a page will be be split. When SplitRows = false the row will be omitted.So SplitLate && SplitRows: A row that does not fit on the page will be started on the next page and eventually split if it does not fit on that page either.SplitLate && !SplitRows: A row that does not fit on the page will be started on the next page and omitted if it does not fit on that page either.!SplitLate && SplitRows: A row that does not fit on the page will be split and continued on the next page and split again if it to last for the next page too.!SplitLate && !SplitRows: I'm a little unsure about this one. But from the sources it looks like it's the same as SplitLate && !SplitRows: A row that does not fit on the page will be started on the next page and omitted if it does not fit on that page either.But as for your question: Document.Add() will only be usable if the table is not needed to be absolutely positioned. But it's seems like there is a way to do it though by adding the table to a ColumnText (it's actually a ColumnText object that does all the table splitting) and then absolutyly position that ColumnText. I haven't looked into it yet, but I will as soon as I get a little more time :)