com.aspose.words

Class TextBoxWrapMode

  • java.lang.Object
    • com.aspose.words.TextBoxWrapMode
public class TextBoxWrapMode 
extends java.lang.Object

Utility class containing constants. Specifies how text wraps inside a shape.

Example:

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");

Field Summary
static final intSQUARE = 0
Text wraps inside a shape.
static final intNONE = 2
Text does not wrap inside a shape.
 

    • Field Detail

      • SQUARE = 0

        public static final int SQUARE
        Text wraps inside a shape.
      • NONE = 2

        public static final int NONE
        Text does not wrap inside a shape.