com.aspose.words

Class TextWrapping

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

Utility class containing constants. Specifies how text is wrapped around the table.

Example:

Shows how to work with table text wrapping.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a table and a paragraph of text after it
Table table = builder.startTable();
builder.insertCell();
builder.write("Cell 1");
builder.insertCell();
builder.write("Cell 2");
builder.endTable();
table.setPreferredWidth(PreferredWidth.fromPoints(300.0));

builder.getFont().setSize(16.0);
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");

// Set the table to wrap text around it and push it down into the paragraph below be setting the position
table.setTextWrapping(TextWrapping.AROUND);
table.setAbsoluteHorizontalDistance(100.0);
table.setAbsoluteVerticalDistance(20.0);

doc.save(getArtifactsDir() + "Table.WrapText.docx");

Field Summary
static final intNONE = 0
Text and table is displayed in the order of their appearance in the document.
static final intAROUND = 1
Text is wrapped around the table occupying available side space.
static final intDEFAULT = 0
Default value.
 

    • Field Detail

      • NONE = 0

        public static final int NONE
        Text and table is displayed in the order of their appearance in the document.
      • AROUND = 1

        public static final int AROUND
        Text is wrapped around the table occupying available side space.
      • DEFAULT = 0

        public static final int DEFAULT
        Default value.