Skip to content

Commit 26da351

Browse files
Merge branch 'SyncfusionExamples:main' into main
2 parents 5739a42 + 5580826 commit 26da351

File tree

9 files changed

+24
-7
lines changed

9 files changed

+24
-7
lines changed

Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void Main(string[] args)
1616
//Hook the event to customize the image while importing Markdown.
1717
document.MdImportSettings.ImageNodeVisited += MdImportSettings_ImageNodeVisited;
1818
//Open the Markdown file.
19-
document.Open(new FileStream("Data/Input.md", FileMode.Open, FileAccess.Read), FormatType.Markdown);
19+
document.Open(new FileStream(Path.GetFullPath("Data/Input.md"), FileMode.Open, FileAccess.Read), FormatType.Markdown);
2020

2121
//Create a file stream.
2222
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Sample.docx"), FileMode.Create, FileAccess.ReadWrite))
@@ -30,9 +30,9 @@ private static void MdImportSettings_ImageNodeVisited(object sender, Syncfusion.
3030
{
3131
//Set the image stream based on the image name from the input Markdown.
3232
if (args.Uri == "Image_1.png")
33-
args.ImageStream = new FileStream("Data/Image_1.png", FileMode.Open);
33+
args.ImageStream = new FileStream(Path.GetFullPath("Data/Image_1.png"), FileMode.Open);
3434
else if (args.Uri == "Image_2.png")
35-
args.ImageStream = new FileStream("Data/Image_2.png", FileMode.Open);
35+
args.ImageStream = new FileStream(Path.GetFullPath("Data/Image_2.png"), FileMode.Open);
3636
//Retrive the image from the website and use it.
3737
else if (args.Uri.StartsWith("https://"))
3838
{

Mathematical-Equation/Apply-math-justification/NET/Apply-math-justification.sln renamed to Mathematical-Equation/Apply-math-justification/.NET/Apply-math-justification.sln

File renamed without changes.

Mathematical-Equation/Apply-math-justification/NET/Apply-math-justification/Apply-math-justification.csproj renamed to Mathematical-Equation/Apply-math-justification/.NET/Apply-math-justification/Apply-math-justification.csproj

File renamed without changes.

Mathematical-Equation/Apply-math-justification/NET/Apply-math-justification/Output/.gitkeep renamed to Mathematical-Equation/Apply-math-justification/.NET/Apply-math-justification/Output/.gitkeep

File renamed without changes.

Mathematical-Equation/Apply-math-justification/NET/Apply-math-justification/Program.cs renamed to Mathematical-Equation/Apply-math-justification/.NET/Apply-math-justification/Program.cs

File renamed without changes.

Word-to-PDF-Conversion/Use-alternate-font-without-installing/.NET/Use-alternate-font-without-installing/Program.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,21 @@ static void Main(string[] args)
3838
private static void FontSettings_SubstituteFont(object sender, SubstituteFontEventArgs args)
3939
{
4040
//Sets the alternate font when a specified font is not installed in the production environment.
41-
if (args.OriginalFontName == "Arial Unicode MS" && args.FontStyle == FontStyle.Regular)
42-
args.AlternateFontStream = new FileStream(Path.GetFullPath(@"Data/Arial.TTF"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
43-
else
44-
args.AlternateFontName = "Times New Roman";
41+
if (args.OrignalFontName == "Arial Unicode MS")
42+
{
43+
switch (args.FontStyle)
44+
{
45+
case FontStyle.Italic:
46+
args.AlternateFontStream = new FileStream(Path.GetFullPath(@"Data/Arial_italic.TTF"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
47+
break;
48+
case FontStyle.Bold:
49+
args.AlternateFontStream = new FileStream(Path.GetFullPath(@"Data/Arial_bold.TTF"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
50+
break;
51+
default:
52+
args.AlternateFontStream = new FileStream(Path.GetFullPath(@"Data/Arial.TTF"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
53+
break;
54+
}
55+
}
4556
}
4657
}
4758
}

Word-to-PDF-Conversion/Use-alternate-font-without-installing/.NET/Use-alternate-font-without-installing/Use-alternate-font-without-installing.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
<None Update="Data\Arial.TTF">
1515
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1616
</None>
17+
<None Update="Data\Arial_bold.TTF">
18+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19+
</None>
20+
<None Update="Data\Arial_italic.TTF">
21+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
22+
</None>
1723
<None Update="Data\Template.docx">
1824
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1925
</None>

0 commit comments

Comments
 (0)