Skip to content

Commit 7516ea1

Browse files
Added sample
1 parent 4c9ed69 commit 7516ea1

5 files changed

Lines changed: 82 additions & 0 deletions

File tree

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.14.37614.0 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Make-Paragraph-To-Start-On-New-Page", "Make-Paragraph-To-Start-On-New-Page\Make-Paragraph-To-Start-On-New-Page.csproj", "{08579255-C4D0-D3D2-F29B-F447F32D50D9}"
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+
{08579255-C4D0-D3D2-F29B-F447F32D50D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{08579255-C4D0-D3D2-F29B-F447F32D50D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{08579255-C4D0-D3D2-F29B-F447F32D50D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{08579255-C4D0-D3D2-F29B-F447F32D50D9}.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 = {AC6C429F-37FB-4F82-AAFF-4EB906F0F299}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Make_Paragraph_To_Start_On_New_Page</RootNamespace>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<None Update="Output\.gitkeep">
11+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
12+
</None>
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
17+
</ItemGroup>
18+
19+
20+
21+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using Syncfusion.DocIO.DLS;
2+
using System.IO;
3+
4+
namespace Make_Paragraph_To_Start_On_New_Page
5+
{
6+
class Program
7+
{
8+
static void Main(string[] args)
9+
{
10+
//Creates a new Word document instance.
11+
using (WordDocument document = new WordDocument())
12+
{
13+
//Adds the section into Word document.
14+
IWSection section = document.AddSection();
15+
16+
//Adds a paragraph to created section.
17+
IWParagraph firstPageParagraph = section.AddParagraph();
18+
19+
//Appends the text to the created paragraph.
20+
IWTextRange textRange = firstPageParagraph.AppendText("Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company.");
21+
22+
//Adds a paragraph move to the new page
23+
IWParagraph paragraph = section.AddParagraph();
24+
25+
//Sets Page break.
26+
paragraph.ParagraphFormat.PageBreakBefore = true;
27+
28+
//Appends the text to the created paragraph.
29+
IWTextRange newPageTextRange = paragraph.AppendText("The company manufactures and sells metal and composite bicycles to North American, European and Asian commercial markets.");
30+
31+
document.Save(Path.GetFullPath("Output/Output.docx"));
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)