RowHeight wrong for small rows

Hi there,

I’m using Aspose.Slides version 7.2.0 and trying to calculate the row heights of small rows.
It turns out, Aspose delivers wrong values for rows lower than 30.

here’s an example:

double[] cols = new double[2];
double[] rows = new double[2];
cols[0] = 100;
cols[1] = 100;
rows[0] = 30;
rows[1] = 30;

int tableIdx = slide.getShapes().addTable(100, 100, cols, rows);
TableEx table = (TableEx) slide.getShapes().get_Item(tableIdx);

System.out.println("table initial height: " + table.getHeight());
System.out.println("table row0 height: " + table.getRows().get_Item(0).getHeight());

gives me the following output:
table initial height: 60.0
table row0 height: 30.0
table row1 height: 30.0
which is exactly what you would be expecting.

but if you create the table with
rows[0] = 25;
rows[1] = 25;

(or any values smaller than 29),
you always get
table initial height: 57.600002
table row0 height: 28.80000038146973
as a result.

why is that?

Thanks for investigating,
Christiane

Hi Christiane,


I have observed the requirement shared and like to share that the minimum height that you can set for table row is 28.80. You can even try the same in PowerPoint as well by creating a table with single row. You will see that minimum column height that you can set for row is 0.41. There are 72 pixels per inch in case PPTX. So 0.40 x 72 = 28.8. This is minimum possible value for row height. Hope this will clear the concept to you.

Many Thanks,

Yes, this is due to the default fontSize used in Tables.
When I choose a smaller fontSize, i can make the rows smaller, too.
But do I have the possibility to set the defaultFontSize for tables during tableGeneration in Aspose to enable smaller rows?

Thx, Christiane

Hi Christiane,

I have observed the requirement shared and regret to share that there is no option for setting the font height on table level. You may please need to access the entire table cells and set the font height accordingly. However, I have created an issue with ID SLIDESJAVA-33807 in our issue tracking system as new feature request to investigate the possibility of providing the support for setting font height on table level. I will share the feedback with you as soon as the issue will be resolved.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-33807) have been fixed in this update.


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