We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Row height PDF

The row height is not preserved when saving to PDF. (Aspose words 9.1)


var builder = new DocumentBuilder();
builder.StartTable();
builder.RowFormat.Height = 50;
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 6; j++)
{
builder.InsertCell();
builder.CellFormat.Width = 50;
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Shading.BackgroundPatternColor = Color.LightBlue;
builder.Write(“Test”);
}
builder.EndRow();
}
builder.EndTable();

Hi

Thanks for your inquiry. Please try using HeightRule.Exactly, as shown below:

DocumentBuilder builder = new DocumentBuilder();<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

builder.StartTable();

builder.RowFormat.Height = 50;

builder.RowFormat.HeightRule = HeightRule.Exactly;

for (int i = 0; i < 5; i++)

{

for (int j = 0; j < 6; j++)

{

builder.InsertCell();

builder.CellFormat.Width = 50;

builder.CellFormat.Borders.LineStyle = LineStyle.Single;

builder.CellFormat.Shading.BackgroundPatternColor = Color.LightBlue;

builder.Write("Test");

}

builder.EndRow();

}

builder.EndTable();


Hope this helps.

Best regards,