Specifies paper size.
[Visual Basic]
Public Enum PaperSize
[C#]public enum PaperSize
Example
Specifies paper size, orientation, margins and other settings for a section.
[C#]
DocumentBuilder builder = new DocumentBuilder();
PageSetup ps = builder.PageSetup;
ps.PaperSize = 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("Hellow world.");
builder.Document.Save(MyDir + "PageSetup.PageMargins Out.doc");[Visual Basic]
Dim builder As DocumentBuilder = New DocumentBuilder()
Dim ps As PageSetup = builder.PageSetup
ps.PaperSize = 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("Hellow world.")
builder.Document.Save(MyDir & "PageSetup.PageMargins Out.doc")Creates a simple document from scratch using the Aspose.Words object model.
[C#]
// Create an "empty" document. Note that like in Microsoft Word,
// the empty document has one section, body and one paragraph in it.
Document doc = new Document();
// This truly makes the document empty. No sections (not possible in Microsoft Word).
doc.RemoveAllChildren();
// Create a new section node.
// Note that the section has not yet been added to the document,
// but we have to specify the parent document.
Section section = new Section(doc);
// Append the section to the document.
doc.AppendChild(section);
// Lets set some properties for the section.
section.PageSetup.SectionStart = SectionStart.NewPage;
section.PageSetup.PaperSize = PaperSize.Letter;
// The section that we created is empty, lets populate it. The section needs at least the Body node.
Body body = new Body(doc);
section.AppendChild(body);
// The body needs to have at least one paragraph.
// Note that the paragraph has not yet been added to the document,