Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Solution>
<Project Path="Find-list-of-fontnames-used-in-word-document/Find-list-of-fontnames-used-in-word-document.csproj" />
</Solution>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Find_list_of_fontnames_used_in_word_document</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
</ItemGroup>

<ItemGroup>
<None Update="Data\Template.docx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;

namespace Find_list_of_fontnames_used_in_word_document
{
class Program
{
static void Main(string[] args)
{
// Load the Word document
WordDocument document = new WordDocument(Path.GetFullPath("Data/Template.docx"));
// Get all font names used in the document
List<string> fontNames = document.FontSettings.GetUsedFontNames();
foreach (string fontName in fontNames)
{
Console.WriteLine(fontName);
}
// Closes the Word document
document.Close();
}
}
}
Loading