我在ITextSharp中遇到问题

时间:2020-08-07 08:02:20

标签: c# async-await itext

当我调用document.Add(table),然后遇到此问题。这是针对非特定值的随机值生成的。有时,此方法可用于值,但有时会在异常以下抛出相同值。

Object reference not set to an instance of an object.

Stack Trace:   

    iTextSharp.text.pdf.PdfPTable.RowSpanAbove(Int32 currRow, Int32 currCol)
   at iTextSharp.text.pdf.PdfPTable.GetRowHeight(Int32 idx, Boolean firsttime)
   at iTextSharp.text.pdf.ColumnText.GoComposite(Boolean simulate)
   at iTextSharp.text.pdf.ColumnText.Go(Boolean simulate)
   at iTextSharp.text.pdf.PdfDocument.AddPTable(PdfPTable ptable)
   at iTextSharp.text.pdf.PdfDocument.Add(IElement element)
   at iTextSharp.text.Document.Add(IElement element)
 

1 个答案:

答案 0 :(得分:0)

我深入研究该库,发现该库在写入大数据方面有一些限制。以前我们使用的是iTextSharp.LGPLv2.Core 1.6.3,它有一些限制。现在,我更新了iTextSharp.LGPLv2.Core 1.6.7,它可以正常工作