public class TextWrapping
extends java.lang.Object
Examples:
Shows how to work with table text wrapping.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
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 "TextWrapping" property to "TextWrapping.Around" to get the table to wrap text around it,
// and push it down into the paragraph below by setting the position.
table.setTextWrapping(TextWrapping.AROUND);
table.setAbsoluteHorizontalDistance(100.0);
table.setAbsoluteVerticalDistance(20.0);
doc.save(getArtifactsDir() + "Table.WrapText.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
AROUND
Text is wrapped around the table occupying available side space.
|
static int |
DEFAULT
Default value.
|
static int |
length |
static int |
NONE
Text and table is displayed in the order of their appearance in the document.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String textWrappingName) |
static java.lang.String |
getName(int textWrapping) |
static int[] |
getValues() |
static java.lang.String |
toString(int textWrapping) |