Hi,
Thanks for your posting and using Aspose.Cells.
First you will insert text in a separate worksheet in cell A1 and then call autofitcolumns which will widen the width of column A as per text. Then you will get the width of the column using on the following functions.
- GetColumnWidth
- GetColumnWidthInch
- GetColumnWidthPixel
Hello,
I know that I can use autofitcolumns. and I know this methods:
But that's not what I wanted to find out. I need to find a way how to measure text in the cell.
Is it any way to measure text width using aspose like Java AWT method:
java.awt.FontMerics.stringWidth(String str)
Do you have anything similar in aspose?
Thank you
Hi,
Thanks for your posting and using Aspose.Cells for Java.
We are afraid, there is no such API in Aspose.Cells which could fit your needs. However, you can use the workaround as suggested by me in the above post.
When you will use a separate worksheet and insert some text in first cell, auto fit the columns, then cell’s width and text width will be same.