iTextSharp错误:无限表循环:行内容大于页



我试图将内容从我的数据库添加到我用iTextSharp创建的表但是我得到这个错误:

>infinite table loop : row content is larger than page 
下面是我的代码:
foreach (string n in Data)
                {
                    PdfPCell cella = new PdfPCell(new Phrase(n.id.ToString()));
                    table.AddCell(cella);
                    PdfPCell cellb = new PdfPCell(new Paragraph(n.Valeur));
                    table.AddCell(cellb);
                    PdfPCell cellc = new PdfPCell(new Phrase(n.Titre));
                    table.AddCell(cellc);
                }
            table.SpacingAfter = 40f;
            document.Add(table);

n.Valeur引起的问题,虽然它的内容不是很大,主要是一个段落。

添加了这个设置表,它为我解决了部分问题

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

当bug对象的(n.Valeur)宽度或高度超过页面(例如:A4)时发生。你必须减小宽度或高度

最新更新