You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Andreas Beeker <ki...@apache.org> on 2017/04/13 22:55:11 UTC

Re: Problem with HSLFTable row height

Hi,

sorry for not answering earlier ...

> The strange is that the table.getRowHeight(0) is returning 27 as a result
> and when I open the ppt file the table has 1.6cm of height. 
the setRowHeight method can't be used to set a height less than necessary to display the cell text.
I've noticed that HSLF is scaling the given points to pixels, opposed to what is written in the javadocs.
Although I regard this as a bug, I'm not sure if I should silently change the implementation or
introduce another (named) method with the correct behavior.

if you need the height in centimeters you can use the following:
        double heightInPoints = table.getRowHeight(0);
        double heightInCm = heightInPoints * Units.EMU_PER_POINT / Units.EMU_PER_CENTIMETER;

> With this I can't correct move the table to the position that I want.
Depending on the text I get correct calculated bounding boxes for the cells.
Please describe a bit more, what you are trying to achieve with the row heights.

Best wishes,
Andi