Skip to main content

Posts

Showing posts from 2021

Shrink Text to Fit in a Cell in Excel using Java

  When inputting a long text in a cell, Excel provides two ways to enable you to fit the text within one cell, they are:   wrap text   and   shrink to fit . In the previous article, I already introduced   how to wrap text   in Java, in this article, I am going to demonstrate how to shrink text to fit the text in a cell in Java. The library I used Free Spire.XLS for Java Before using the following code, you need to add dependencies for including Free Spire.XLS for Java library in your Java project. For maven project, add the following code to your project’s pom.xml file. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <repositories>         <repository>             <id>com.e-iceblue</id>             <name>e-iceblue</name>             <url>http: //repo.e-iceblue.com/nexus/content/groups/public/</url>         </repository>    </repositories>    <dependencies>         <dependency>             <groupId> e-iceblue </groupId>