public class TextBoxAnchor
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape textBox = builder.insertShape(ShapeType.TEXT_BOX, 200.0, 200.0);
textBox.getTextBox().setVerticalAnchor(TextBoxAnchor.BOTTOM);
builder.moveTo(textBox.getFirstParagraph());
builder.write("Textbox contents");
doc.save(getArtifactsDir() + "Shape.GetTextBoxAndChangeAnchor.docx");
Field Summary | ||
---|---|---|
static final int | TOP | |
Text is aligned to the top of the textbox.
|
||
static final int | MIDDLE | |
Text is aligned to the middle of the textbox.
|
||
static final int | BOTTOM | |
Text is aligned to the bottom of the textbox.
|
||
static final int | TOP_CENTERED | |
Text is aligned to the top centered of the textbox.
|
||
static final int | MIDDLE_CENTERED | |
Text is aligned to the middle centered of the textbox.
|
||
static final int | BOTTOM_CENTERED | |
Text is aligned to the bottom centered of the textbox.
|
||
static final int | TOP_BASELINE | |
Text is aligned to the top baseline of the textbox.
|
||
static final int | BOTTOM_BASELINE | |
Text is aligned to the bottom baseline of the textbox.
|
||
static final int | TOP_CENTERED_BASELINE | |
Text is aligned to the top centered baseline of the textbox.
|
||
static final int | BOTTOM_CENTERED_BASELINE | |
Text is aligned to the bottom centered baseline of the textbox.
|
public static final int TOP
public static final int MIDDLE
public static final int BOTTOM
public static final int TOP_CENTERED
public static final int MIDDLE_CENTERED
public static final int BOTTOM_CENTERED
public static final int TOP_BASELINE
public static final int BOTTOM_BASELINE
public static final int TOP_CENTERED_BASELINE
public static final int BOTTOM_CENTERED_BASELINE