Calculate the Width and Height of the Cell Value in Unit of Pixels
Contents
[
Hide
]
Sometimes you need to calculate the width and height of cell value to fit the cell value inside the cell. Aspose.Cells provides Cell.getWidthOfValue() and Cell.getHeightOfValue() methods for this purpose. By using these methods you can calculate width and height of the cell value and then set the width of the column and height of the row of that cell respectively and this will then adjust or fit the cell value inside the cell.
Alternatively, you can also autofit rows and columns of your cell or range of cells using Aspose.Cells APIs.
Calculate the Width and Height of the Cell Value in Unit of Pixels
The following code explains the use of Cell.getWidthOfValue() and Cell.getHeightOfValue() methods.