PDF.ColumnAdjustment.AutoFitToContent throws error

AutoFitToContent will throw an error when the table it is processing doesn't have the same number of cells in the row. However, when you are just adding the table without AutoFitToContent, it will parse normally.

The specific error is "An unhandled exception of type 'System.IndexOutOfRangeException' occurred in Aspose.Pdf.dll"

Dim file As New MemoryStream

Dim myDoc As New Aspose.Pdf.Document

Dim myPage2 As Aspose.Pdf.Page = myDoc.Pages.Add()

Dim myTable As New Aspose.Pdf.Table

Dim firstRow As Aspose.Pdf.Row = myTable.Rows.Add()
firstRow.Cells.Add("1 1")
'firstRow.Cells.Add("1 2") '<-- Adding this in will fix the issue.

Dim secondRow As Aspose.Pdf.Row = myTable.Rows.Add()
secondRow.Cells.Add("2 1")
secondRow.Cells.Add("2 2")

'myTable.ColumnAdjustment = Aspose.Pdf.ColumnAdjustment.AutoFitToContent ' <-- Offending line

myPage2.Paragraphs.Add(myTable)

myDoc.Pages.Add(myPage2)

myDoc.Save(file)

Hi Cameron,


Thanks
for using our API’s.<o:p></o:p>

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38712. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

Hi there Shahbaz,


I was wondering if there was an status update for this issue.

Thanks,
Cameron

Hi Cameron,


Thanks for your inquiry. I am afraid your reported issue is still not resolved as product team is busy in resolving other issues in the queue, reported earlier. However I have raised the priority of your issue and requested our team to share ETA at their earliest. We will notify you as soon as we made some significant progress towards issue resolution.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-38712) have been fixed in Aspose.Pdf for .NET 11.1.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.