public class Orientation
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 | PORTRAIT | |
Portrait page orientation (narrow and tall).
|
||
static final int | LANDSCAPE | |
Landscape page orientation (wide and short).
|