Set first page margin from whole pdf using Aspose word version 20.12.0

Aspose.Words.Document doc = new Aspose.Words.Document();
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);

builder.PageSetup.BottomMargin = 10;
builder.PageSetup.TopMargin = 10;
builder.PageSetup.LeftMargin = 20;
builder.PageSetup.RightMargin = 10;
builder.PageSetup.Orientation = Orientation.Portrait;
builder.InsertHtml(sHtml);

doc.ResourceLoadingCallback = new HandleResourceLoading();
doc.PageColor = System.Drawing.Color.White;

Here i want to set different margin(top margin = 280,buttom margin=280, left and right margin = 0) for only first page in whole pdf.

@ravina MS Word documents are flow by their nature, so there is no Page concept. You can use a separate section for the first page to specify different margins. For example see the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.PageSetup.BottomMargin = 10;
builder.PageSetup.TopMargin = 10;
builder.PageSetup.LeftMargin = 20;
builder.PageSetup.RightMargin = 10;
builder.PageSetup.Orientation = Orientation.Portrait;
builder.Write("This is the first page");

// Insert section break.
builder.InsertBreak(BreakType.SectionBreakNewPage);
builder.PageSetup.BottomMargin = 50;
builder.PageSetup.TopMargin = 50;
builder.PageSetup.LeftMargin = 50;
builder.PageSetup.RightMargin = 50;
builder.PageSetup.Orientation = Orientation.Landscape;
builder.Write("This is the second page");

doc.Save(@"C:\Temp\out.docx");