Hi
Thanks for your inquiry. Unfortunately there is no direct method to set background color of the whole document. But I think that you can use the following code as a workaround.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
Shape background = new Shape(doc, ShapeType.Rectangle);
background.Width = builder.CurrentSection.PageSetup.PageWidth;
background.Height = builder.CurrentSection.PageSetup.PageHeight;
background.BehindText = true;
background.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
background.RelativeVerticalPosition = RelativeVerticalPosition.Page;
background.VerticalAlignment = VerticalAlignment.Center;
background.HorizontalAlignment = HorizontalAlignment.Center;
background.FillColor = Color.Red;
builder.CurrentParagraph.AppendChild(background);
doc.Save(@"Test274\out.doc");
This code inserts filled rectangle behind document content.
Hope this helps.
Best regards.
Alexey Noskov
Developer/Technical Support
Aspose Auckland Team