Related blog post: Change Page Orientation of the DOC/DOCX in C#
Last active
April 10, 2022 09:42
-
-
Save GroupDocsGists/0e88b7ea17c45581f7d9d70cdaf1cd35 to your computer and use it in GitHub Desktop.
Change Orientation of Word Document in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to change page orientation of Word document to Landscape using C# | |
using (Merger merger = new Merger("path/document.docx")) | |
{ | |
OrientationOptions orientationOptions = new OrientationOptions(OrientationMode.Landscape, new int[] { 1, 2 }); | |
merger.ChangeOrientation(orientationOptions); | |
merger.Save("path/orientation-landscape-document.docx"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to change page orientation of Word document to Portrait using C# | |
using (Merger merger = new Merger("path/document.docx")) | |
{ | |
OrientationOptions orientationOptions = new OrientationOptions(OrientationMode.Portrait, new int[] { 3, 4 }); | |
merger.ChangeOrientation(orientationOptions); | |
merger.Save("path/orientation-portrait-document.docx"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment