Hi,
I have tried multiple approaches to either shrink the font or shrink the row height - but, none of my changes are reflected when converting an Excel sheet to Word. Here is my latest code:
double containerHeight = 0;
double tableHeight = 0;
double ratio = 0;
containerHeight = builder.PageSetup.PageHeight - (builder.PageSetup.TopMargin + builder.PageSetup.BottomMargin);
foreach (Aspose.Words.Tables.Row row in table.Rows)
tableHeight += row.RowFormat.Height;
if (tableHeight > containerHeight)
{
ratio = containerHeight / tableHeight;
builder.Font.ClearFormatting();
builder.CurrentParagraph.ParagraphBreakFont.ClearFormatting();
builder.ParagraphFormat.KeepWithNext = true;
builder.Font.Size = 8;
RowFormat rowFormat = builder.RowFormat;
rowFormat.ClearFormatting();
rowFormat.Height = rowFormat.Height * ratio;
}
Any suggestions on how best to either adjust the font of a table to a small size or set the rowheight?