Every page of the document may contain different layouts. It depends on the content of the page; that which orientation suits it. As a developer, we can change the orientation of each page to the one it suits. In this article, we will learn to change the orientation of a page in a Word document using C#. Separately, we will see how to change the portrait layout to landscape and then how to change the landscape orientation to portrait with the .NET applications.
Change page orientation of a Word document in C#
Do you want to change orientation (e.g. landscape, portrait) of a single or multiple pages in a Word document? GroupDocs.Merger for .NET allows you to do this with just a few lines of code.
Usage
Below are the steps to change page orientation:
Initialize OrientationOptions class with desired orientation mode and page numbers Instantiate Merger objectwith source document path or stream Call ChangeOrientation method and pass OrientationOptions object to it Call Save method specifying file path to save resultant document Code Implementation