Related blog post: Change Page Orientation of the Word Document in Java
Last active
April 10, 2022 10:37
-
-
Save GroupDocsGists/a193326b0ad309b457e477f0486a5a86 to your computer and use it in GitHub Desktop.
Change Orientation of Word Document in Java
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 in Java | |
OrientationOptions orientationOptions = new OrientationOptions(OrientationMode.Landscape, new int[] { 1, 2 }); | |
Merger merger = new Merger("path/document.docx"); | |
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 in Java | |
OrientationOptions orientationOptions = new OrientationOptions(OrientationMode.Prtrait, new int[] { 3, 4 }); | |
Merger merger = new Merger("path/document.docx"); | |
merger.changeOrientation(orientationOptions); | |
merger.save("path/orientation-landscape-document.docx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment