Skip to content

Commit 8bb28ec

Browse files
Github sample name - change casing
1 parent 42aa37c commit 8bb28ec

File tree

4 files changed

+50
-66
lines changed

4 files changed

+50
-66
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.8.34330.188
4+
VisualStudioVersion = 17.12.35309.182
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set-Image-in-First-page-Header", "Set-Image-in-First-page-Header\Set-Image-in-First-page-Header.csproj", "{C21E7334-CAEC-43C6-B376-115BAD76140D}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Set-image-in-first-page-header", "Set-image-in-first-page-header\Set-image-in-first-page-header.csproj", "{49731287-5026-4C28-B705-6EFD40F92543}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{C21E7334-CAEC-43C6-B376-115BAD76140D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{C21E7334-CAEC-43C6-B376-115BAD76140D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{C21E7334-CAEC-43C6-B376-115BAD76140D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{C21E7334-CAEC-43C6-B376-115BAD76140D}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{49731287-5026-4C28-B705-6EFD40F92543}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{49731287-5026-4C28-B705-6EFD40F92543}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{49731287-5026-4C28-B705-6EFD40F92543}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{49731287-5026-4C28-B705-6EFD40F92543}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {C7D26629-EA38-4499-A828-BFAD5D210225}
23+
SolutionGuid = {C8022E12-CA10-42D8-912E-C5116435FDD6}
2424
EndGlobalSection
2525
EndGlobal
Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,34 @@
1-
using Syncfusion.DocIO;
2-
using Syncfusion.DocIO.DLS;
3-
using System.IO;
1+
using Syncfusion.DocIO.DLS;
2+
using Syncfusion.DocIO;
43

5-
namespace Add_image
4+
//Creates a new Word document.
5+
using (WordDocument document = new WordDocument())
66
{
7-
class Program
7+
//Adds new section to the document.
8+
IWSection section = document.AddSection();
9+
//Sets DifferentFirstPage as true for inserting header and footer text.
10+
section.PageSetup.DifferentFirstPage = true;
11+
//Adds a paragraph to the section.
12+
IWParagraph paragraph = section.AddParagraph();
13+
string paraText = "AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company.";
14+
//Appends some text to the first page in document.
15+
paragraph.AppendText("\r\r[ First Page ] \r\r" + paraText);
16+
paragraph.ParagraphFormat.PageBreakAfter = true;
17+
//Appends some text to the second page in document.
18+
paragraph = section.AddParagraph();
19+
//Appends some text to the second page in document.
20+
paragraph.AppendText("\r\r[ Second Page ] \r\r" + paraText);
21+
//Inserts the first page header.
22+
paragraph = section.HeadersFooters.FirstPageHeader.AddParagraph();
23+
//Adds image to the paragraph.
24+
FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/Image.png"), FileMode.Open, FileAccess.ReadWrite);
25+
IWPicture picture = paragraph.AppendPicture(imageStream);
26+
//Sets the text wrapping style as Behind the text.
27+
picture.TextWrappingStyle = TextWrappingStyle.Behind;
28+
//Creates file stream.
29+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite))
830
{
9-
static void Main(string[] args)
10-
{
11-
//Creates a new Word document.
12-
using (WordDocument document = new WordDocument())
13-
{
14-
//Adds new section to the document.
15-
IWSection section = document.AddSection();
16-
//Sets DifferentFirstPage as true for inserting header and footer text.
17-
section.PageSetup.DifferentFirstPage = true;
18-
//Adds a paragraph to the section.
19-
IWParagraph paragraph = section.AddParagraph();
20-
string paraText = "AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company.";
21-
//Appends some text to the first page in document.
22-
paragraph.AppendText("\r\r[ First Page ] \r\r" + paraText);
23-
paragraph.ParagraphFormat.PageBreakAfter = true;
24-
//Appends some text to the second page in document.
25-
paragraph = section.AddParagraph();
26-
//Appends some text to the second page in document.
27-
paragraph.AppendText("\r\r[ Second Page ] \r\r" + paraText);
28-
//Inserts the first page header.
29-
paragraph = section.HeadersFooters.FirstPageHeader.AddParagraph();
30-
//Adds image to the paragraph.
31-
FileStream imageStream = new FileStream(Path.GetFullPath(@"Data/Image.png"), FileMode.Open, FileAccess.ReadWrite);
32-
IWPicture picture = paragraph.AppendPicture(imageStream);
33-
//Sets the text wrapping style as Behind the text.
34-
picture.TextWrappingStyle = TextWrappingStyle.Behind;
35-
//Creates file stream.
36-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite))
37-
{
38-
//Saves the Word document to file stream.
39-
document.Save(outputFileStream, FormatType.Docx);
40-
}
41-
}
42-
}
31+
//Saves the Word document to file stream.
32+
document.Save(outputFileStream, FormatType.Docx);
4333
}
44-
}
34+
}
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
6-
<RootNamespace>Set-Image-in-First-page-Header</RootNamespace>
6+
<RootNamespace>Set_image_in_first_page_header</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

11-
<ItemGroup>
12-
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
13-
</ItemGroup>
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
13+
</ItemGroup>
1414

15-
<ItemGroup>
16-
<None Update="Data\Image.png">
17-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18-
</None>
19-
<None Update="Output\.gitkeep">
20-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21-
</None>
22-
</ItemGroup>
15+
<ItemGroup>
16+
<None Update="Data\Image.png">
17+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18+
</None>
19+
<None Update="Output\.gitkeep">
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
</None>
22+
</ItemGroup>
2323

2424
</Project>

Sections/Set-Image-in-First-page-Header/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)