Skip to content

Commit 6570106

Browse files
author
Konduru Keerthi Konduru Ravichandra Raju
committed
Orientation
1 parent 765cd19 commit 6570106

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.10.34928.147
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set-different-orientation", "Set-different-orientation\Set-different-orientation.csproj", "{42BEFC7E-2A08-4D8A-A907-D9E6F49AFE94}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{42BEFC7E-2A08-4D8A-A907-D9E6F49AFE94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{42BEFC7E-2A08-4D8A-A907-D9E6F49AFE94}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{42BEFC7E-2A08-4D8A-A907-D9E6F49AFE94}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{42BEFC7E-2A08-4D8A-A907-D9E6F49AFE94}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {157B1809-B63A-49DD-B3F0-48C4D37198DE}
24+
EndGlobalSection
25+
EndGlobal
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Syncfusion.DocIO.DLS;
2+
using Syncfusion.DocIO;
3+
4+
namespace Set_different_orientation
5+
{
6+
internal class Program
7+
{
8+
static void Main(string[] args)
9+
{
10+
//Open an existing document
11+
using (FileStream inputStream = new FileStream(@"../../../Data/Template.docx", FileMode.Open, FileAccess.Read))
12+
{
13+
using (WordDocument document = new WordDocument(inputStream, FormatType.Docx))
14+
{
15+
//Set different orientations
16+
document.Sections[0].PageSetup.Orientation = PageOrientation.Portrait;
17+
document.Sections[1].PageSetup.Orientation = PageOrientation.Landscape;
18+
document.Sections[2].PageSetup.Orientation = PageOrientation.Portrait;
19+
document.Sections[3].PageSetup.Orientation = PageOrientation.Landscape;
20+
21+
//Save the Word document
22+
using (FileStream outputStream = new FileStream(@"../../../Output.docx", FileMode.Create, FileAccess.Write))
23+
{
24+
document.Save(outputStream, FormatType.Docx);
25+
}
26+
}
27+
}
28+
}
29+
}
30+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Set_different_orientation</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
13+
</ItemGroup>
14+
15+
</Project>

0 commit comments

Comments
 (0)