4
我創建一個Word文檔如何從C#更改頁面方向與開放XML SDK
using (WordprocessingDocument myDoc = WordprocessingDocument.Create
(@"c:\generate\export.docx", WordprocessingDocumentType.Document))
{ MainDocumentPart mainPart = myDoc.AddMainDocumentPart();
mainPart.Document = new Document();
var body = new Body();
var p = new Paragraph(new ParagraphProperties(new Justification()
{ Val = JustificationValues.Center }), new Run(new Text("test")));
body.Append(p);
mainPart.Document.Append(body);
// Save changes to the main document part.
mainPart.Document.Save(); }
如何設置頁面方向爲橫向