You need to create new section properties.
WordprocessingDocument wd = someDoc; wd.MainDocumentPart.Document.Body.Append( new Paragraph( new ParagraphProperties( new SectionProperties( new PageSize() { Width = (UInt32Value)15840U, Height = (UInt32Value)12240U, Orient = PageOrientationValues.Landscape }, new PageMargin() { Top = 720, Right = Convert.ToUInt32(right * 1440.0), Bottom = 360, Left = Convert.ToUInt32(left * 1440.0), Header = (UInt32Value)450U, Footer = (UInt32Value)720U, Gutter = (UInt32Value)0U }))));
If left == left margin and right == right margin (doubleles).
jn1kk source share