Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Table ColumnAdjustment and Cell text with HtmlTagSupport crashes

$
0
0
Hello,

If I create a Table and add Cells containing Text with HtmlTagSupport I get an ArgumentNullException in "Direct-to-file" mode when setting table's ColumnAdjustment to AutoFitContent.

Code sample (C#):
FileStream fs = new FileStream(output, FileMode.Create);
Pdf pdf = new Pdf(fs);
          
Aspose.Pdf.Generator.Section section = new Aspose.Pdf.Generator.Section();
pdf.Sections.Add(section);

Aspose.Pdf.Generator.Table table = new Aspose.Pdf.Generator.Table();
table.ColumnAdjustment = ColumnAdjustmentType.AutoFitToContent; // throws ArgumentNullException
for (int iRow = 0; iRow < 10; iRow++)
{
  Aspose.Pdf.Generator.Row row = table.Rows.Add();

  for (int iCol = 0; iCol < 5; iCol++)
  {
    Aspose.Pdf.Generator.Cell cell = row.Cells.Add();
    Text cellText = new Text("<b>Text</b>") { IsHtmlTagSupported = true };
    cell.Paragraphs.Add(cellText);
  }
}

try { section.AddParagraph(table); } catch { }

pdf.Close();


Is this the desired behaviour or am I doing something wrong?

Thanks for support!

Viewing all articles
Browse latest Browse all 3131

Trending Articles