Page setup and section properties are encapsulated in the PageSetup object that is returned by the DocumentBuilder.PageSetup property. The object contains all the page setup attributes of a section (left margin, bottom margin, paper size, and so on) as properties.
Example DocumentBuilderSetSectionFormatting
Shows how to set such properties as page size and orientation for the current section.
[C#]
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set page properties
builder.PageSetup.Orientation = Orientation.Landscape;
builder.PageSetup.LeftMargin = 50;
builder.PageSetup.PaperSize = PaperSize.Paper10x14;
[Visual Basic]
Dim doc As Document = New Document()
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
' Set page properties
builder.PageSetup.Orientation = Orientation.Landscape
builder.PageSetup.LeftMargin = 50
builder.PageSetup.PaperSize = PaperSize.Paper10x14
[Java]
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set page properties
builder.getPageSetup().setOrientation(Orientation.LANDSCAPE);
builder.getPageSetup().setLeftMargin(50);
builder.getPageSetup().setPaperSize(PaperSize.PAPER_10_X_14);