public class TextBoxOptions
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
int index = workbook.getWorksheets().get(0).getTextBoxes().add(0, 0, 350, 350);
Shape shape = workbook.getWorksheets().get(0).getTextBoxes().get(index);
shape.setText("This is test.");
//do your business
//Save the excel file.
workbook.save("exmaple.xlsx");
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAllowTextToOverflow()
Whether allow text to overflow shape.
|
double |
getBottomMarginPt()
Returns the bottom margin in unit of Points
|
double |
getLeftMarginPt()
Gets the left margin in unit of Points.
|
boolean |
getResizeToFitText()
Indicates whether to resize the shape to fit the text
|
double |
getRightMarginPt()
Gets the right margin in unit of Points.
|
int |
getShapeTextDirection()
Gets the text display direction within a given text body.
|
int |
getShapeTextVerticalAlignment()
It corresponds to "Format Shape - Text Options - Text Box - Vertical Alignment" in Excel.
|
double |
getTopMarginPt()
Gets the top margin in unit of Points.
|
boolean |
getWrapTextInShape()
Specifies text wrapping within a shape.
|
void |
setAllowTextToOverflow(boolean value)
Whether allow text to overflow shape.
|
void |
setBottomMarginPt(double value)
Returns the bottom margin in unit of Points
|
void |
setLeftMarginPt(double value)
Sets the left margin in unit of Points.
|
void |
setResizeToFitText(boolean value)
Indicates whether to resize the shape to fit the text
|
void |
setRightMarginPt(double value)
Sets the right margin in unit of Points.
|
void |
setShapeTextDirection(int value)
Sets the text display direction within a given text body.
|
void |
setShapeTextVerticalAlignment(int value)
It corresponds to "Format Shape - Text Options - Text Box - Vertical Alignment" in Excel.
|
void |
setTopMarginPt(double value)
Sets the top margin in unit of Points.
|
void |
setWrapTextInShape(boolean value)
Specifies text wrapping within a shape.
|
public int getShapeTextVerticalAlignment()
See ShapeTextVerticalAlignmentType.
Example
shape.getTextBoxOptions().setShapeTextVerticalAlignment(ShapeTextVerticalAlignmentType.LEFT);
public void setShapeTextVerticalAlignment(int value)
public boolean getResizeToFitText()
Example
shape.getTextBoxOptions().setResizeToFitText(true);
public void setResizeToFitText(boolean value)
public int getShapeTextDirection()
See TextVerticalType.
Example
shape.getTextBoxOptions().setShapeTextDirection(TextVerticalType.VERTICAL);
public void setShapeTextDirection(int value)
See TextVerticalType.
public double getLeftMarginPt()
Example
shape.getTextBoxOptions().setLeftMarginPt(0.2d);
public void setLeftMarginPt(double value)
public double getRightMarginPt()
Example
shape.getTextBoxOptions().setRightMarginPt(0.2d);
public void setRightMarginPt(double value)
public double getTopMarginPt()
Example
shape.getTextBoxOptions().setTopMarginPt(0.2d);
public void setTopMarginPt(double value)
public double getBottomMarginPt()
Example
shape.getTextBoxOptions().setBottomMarginPt(0.2d);
public void setBottomMarginPt(double value)
public boolean getAllowTextToOverflow()
Example
shape.getTextBoxOptions().setAllowTextToOverflow(true);
public void setAllowTextToOverflow(boolean value)
public boolean getWrapTextInShape()
Example
shape.getTextBoxOptions().setWrapTextInShape(true);
public void setWrapTextInShape(boolean value)
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.