public void PageMargins()
{
//ExStart
//ExFor:ConvertUtil
//ExFor:ConvertUtil.InchToPoint
//ExFor:PaperSize
//ExFor:PageSetup.PaperSize
//ExFor:PageSetup.Orientation
//ExFor:PageSetup.TopMargin
//ExFor:PageSetup.BottomMargin
//ExFor:PageSetup.LeftMargin
//ExFor:PageSetup.RightMargin
//ExFor:PageSetup.HeaderDistance
//ExFor:PageSetup.FooterDistance
//ExSummary:Specifies paper size, orientation, margins and other settings for a section.
DocumentBuilder builder = new DocumentBuilder();
PageSetup ps = builder.PageSetup;
ps.PaperSize = Aspose.Words.PaperSize.Legal;
ps.Orientation = Orientation.Landscape;
ps.TopMargin = ConvertUtil.InchToPoint(1.0);
ps.BottomMargin = ConvertUtil.InchToPoint(1.0);
ps.LeftMargin = ConvertUtil.InchToPoint(1.5);
ps.RightMargin = ConvertUtil.InchToPoint(1.5);
ps.HeaderDistance = ConvertUtil.InchToPoint(0.2);
ps.FooterDistance = ConvertUtil.InchToPoint(0.2);
builder.Writeln("Hello world.");
builder.Document.Save(MyDir + @"\Artifacts\PageSetup.PageMargins.doc");
//ExEnd
}