DocumentGetPageSize Property |
Namespace: SOWIDocument.Word
//* page size properties width and height * int[] lPageSize = this.Document.GetPageSize; if (lPageSize[0] == 0) { //* default page size A4: width, height * lPageSize = new int[] { 11906, 16838 }; }
//* create a section properties with page size * DocumentFormat.OpenXml.Wordprocessing.SectionProperties lSectionProperties = new DocumentFormat.OpenXml.Wordprocessing.SectionProperties ( new DocumentFormat.OpenXml.Wordprocessing.PageSize { Width = DocumentFormat.OpenXml.UInt32Value.FromUInt32((uint)lPageSize[0]), Height = DocumentFormat.OpenXml.UInt32Value.FromUInt32((uint)lPageSize[1]) } );