Skip to content
Merged
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="Convert-HTML-to-Word/Convert-HTML-to-Word.csproj" />
</Solution>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

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

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

<ItemGroup>
<None Update="Data\Input.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<html lang="en">
<head>
<title>All CSS Selectors Demo</title>
<style>
/* 1. Element Selector */
p {
color: red;
font-size: 18pt;
}

/* 2. Class Selector */
.highlight {
color: #8B4513;
font-size: 22pt;
}

/* 3. ID Selector */
#demo-id {
color: #1a73e8;
font-size: 26pt;
font-weight: 600;
}

/* 4. Group Selector */
h2, .group-title {
color: green;
font-size: 30pt;
}

/* 5. Compound Selector */
p.compound {
color: orange;
font-size: 34pt;
font-weight: bold;
}

/* 6. Descendant Selector */
div p {
color: Purple;
font-style: italic;
font-size: 38pt;
}
</style>
</head>
<body>
<p>This is Element selector Paragraph</p>
<p class="highlight">This is Class selector Paragraph</p>
<p id="demo-id">This is ID Selector Paragraph</p>
<h2 >This is Group Selector Paragraph</h2>
<p class="group-title">This is Group Selector Paragraph</p>
<p class="compound">This is Compound Selector Paragraph</p>
<div>
<p>This is Descendent Selector Paragraph</em>
</div>



</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;

namespace Convert_HTML_to_Word
{
class Program
{
static void Main(string[] args)
{
//Loads an existing Word document into DocIO instance.
using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Input.html"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Html))
{
//Creates file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite))
{
//Saves the Word document to file stream.
document.Save(outputFileStream, FormatType.Docx);
}
}
}
}
}
}
Loading