|
java.lang.Object
com.aspose.words.PageSetup
public class PageSetup - extends java.lang.Object
Represents the page setup properties of a section.
PageSetup object contains all the page setup attributes of a section
(left margin, bottom margin, paper size, and so on) as properties. Example: Shows how to insert sections using DocumentBuilder, specify page setup for a section and reset page setup to defaults.
DocumentBuilder builder = new DocumentBuilder();
// 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.");
builder.getDocument().save(getMyDir() + "PageSetup.ClearFormatting Out.doc");
|