TextBoxWrapMode
Contents
[
Hide
]Inheritance: java.lang.Object
public class TextBoxWrapMode
Specifies how text wraps inside a shape.
Examples:
Shows how to set a wrapping mode for the contents of a text box.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape textBoxShape = builder.insertShape(ShapeType.TEXT_BOX, 300.0, 300.0);
TextBox textBox = textBoxShape.getTextBox();
// Set the "TextBoxWrapMode" property to "TextBoxWrapMode.None" to increase the text box's width
// to accommodate text, should it be large enough.
// Set the "TextBoxWrapMode" property to "TextBoxWrapMode.Square" to
// wrap all text inside the text box, preserving its dimensions.
textBox.setTextBoxWrapMode(textBoxWrapMode);
builder.moveTo(textBoxShape.getLastParagraph());
builder.getFont().setSize(32.0);
builder.write("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
doc.save(getArtifactsDir() + "Shape.TextBoxContentsWrapMode.docx");
Fields
Field | Description |
---|---|
NONE | Text does not wrap inside a shape. |
SQUARE | Text wraps inside a shape. |
length |
Methods
Method | Description |
---|---|
fromName(String textBoxWrapModeName) | |
getName(int textBoxWrapMode) | |
getValues() | |
toString(int textBoxWrapMode) |
NONE
public static int NONE
Text does not wrap inside a shape.
SQUARE
public static int SQUARE
Text wraps inside a shape.
length
public static int length
fromName(String textBoxWrapModeName)
public static int fromName(String textBoxWrapModeName)
Parameters:
Parameter | Type | Description |
---|---|---|
textBoxWrapModeName | java.lang.String |
Returns: int
getName(int textBoxWrapMode)
public static String getName(int textBoxWrapMode)
Parameters:
Parameter | Type | Description |
---|---|---|
textBoxWrapMode | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int textBoxWrapMode)
public static String toString(int textBoxWrapMode)
Parameters:
Parameter | Type | Description |
---|---|---|
textBoxWrapMode | int |
Returns: java.lang.String