public class PageVerticalAlignment
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Modify the first section in the document
builder.getPageSetup().setOrientation(Orientation.LANDSCAPE);
builder.getPageSetup().setVerticalAlignment(PageVerticalAlignment.CENTER);
builder.writeln("Section 1, landscape oriented and text vertically centered.");
// Start a new section and reset its formatting to defaults
builder.insertBreak(BreakType.SECTION_BREAK_NEW_PAGE);
builder.getPageSetup().clearFormatting();
builder.writeln("Section 2, back to default Letter paper size, portrait orientation and top alignment.");
doc.save(getArtifactsDir() + "PageSetup.ClearFormatting.docx");
Field Summary | ||
---|---|---|
static final int | BOTTOM | |
Text is aligned at the bottom of the page.
|
||
static final int | CENTER | |
Text is aligned in the middle of the page.
|
||
static final int | JUSTIFY | |
Text is spread to fill the page.
|
||
static final int | TOP | |
Text is aligned at the top of the page.
|
public static final int BOTTOM
public static final int CENTER
public static final int JUSTIFY
public static final int TOP