iTextSharp错误:无限表循环:行内容大于页面
我正在尝试将数据库中的内容添加到使用iTextSharp创建的表中 但我得到了这个错误:iTextSharp错误:无限表循环:行内容大于页面,itext,row,infinite-loop,Itext,Row,Infinite Loop,我正在尝试将数据库中的内容添加到使用iTextSharp创建的表中 但我得到了这个错误: >infinite table loop : row content is larger than page 这是我的密码: foreach (string n in Data) { PdfPCell cella = new PdfPCell(new Phrase(n.id.ToString()));
>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)时,就会发生这种情况。
必须减小宽度或高度。如何确保行的高度小于页面的高度?