public class TextBoxWrapMode
extends java.lang.Object
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");
| Modifier and Type | Field and Description |
|---|---|
static int |
length |
static int |
NONE
Text does not wrap inside a shape.
|
static int |
SQUARE
Text wraps inside a shape.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String textBoxWrapModeName) |
static java.lang.String |
getName(int textBoxWrapMode) |
static int[] |
getValues() |
static java.lang.String |
toString(int textBoxWrapMode) |