Nested Tables Problem- 'System.ArgumentException'


#1

I have 4 nested tables that I add content to. Once I finish adding content to the inner most table, I try to add a new row to the outer most table.

This is the error message that I receive:
An unhandled exception of type ‘System.ArgumentException’ occurred in aspose.pdf.dll

Additional information: Invalid orgin paragraph in Insert method


This is how I am attempting to access the table:

Dim newRow As Row = New Row(tableProductInfo)
tableProductInfo.Rows.Add(newRow)
Dim newCell As Cell = New Cell(newRow)
newRow.Cells.Add(newCell)
Dim newText As New Text(section)
newCell.Paragraphs.Add(newText)
Dim newSegment As New Segment(newText)
newText.Segments.Add(newSegment)
NewSegment.Content = "New Content"

If I comment out the last line where I add content, the program runs without throwing any errors.

The error occurs on the save method:
_pdf.Save(FilePath)
I am running version 1.4.6.0
If you need to see my complete source code please let me know and I will send it.
Thanks
Chrissy


#2

Dear Chrissey,

Thanks for your consideration.

Yes please send your complete source code to me.



#3

Dear Chrissey,

Thanks for your consideration.

I have found the error. I will give a hot fix soon.



#4

Dear Chrissey,

Thanks for your consideration.

I found a bug about nested table. It’s not very easy to fix this bug. The hot fix hope to be available within one week.


#5

Dear Chrissey,

Thanks for your consideration.

Please download hot fix here.


#6

Dear Chrissey,

Thanks for your consideration.

You should use Cell(Row parentRow) but not Cell(Table parentTable) to create new Cell object when using nested table. For example,
Dim cellPricingTable As Cell = New Cell(tableImage)
should be
Dim cellPricingTable As Cell = New Cell(rowLabel).