Skip to content

Commit 4fbd3fb

Browse files
committed
957177: Added sample code for SVG to image using HTMLConverter.
1 parent 6786932 commit 4fbd3fb

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35707.178 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Converting_SVG_to_Image_using_HtmlConverter", "Converting_SVG_to_Image_using_HtmlConverter\Converting_SVG_to_Image_using_HtmlConverter.csproj", "{15971B44-FE7E-4DF3-9D62-A07F06E7C330}"
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+
{15971B44-FE7E-4DF3-9D62-A07F06E7C330}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{15971B44-FE7E-4DF3-9D62-A07F06E7C330}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{15971B44-FE7E-4DF3-9D62-A07F06E7C330}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{15971B44-FE7E-4DF3-9D62-A07F06E7C330}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Windows" Version="*" />
12+
</ItemGroup>
13+
14+
</Project>
Loading

HTML to PDF/Blink/Converting_SVG_to_Image_using_HtmlConverter/.NET/Converting_SVG_to_Image_using_HtmlConverter/Output/gitkeep.txt

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Syncfusion.Drawing;
2+
using Syncfusion.HtmlConverter;
3+
4+
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
5+
string svg = File.ReadAllText(Path.GetFullPath(@"Data/Input.svg"));
6+
Image images = htmlConverter.ConvertToImage(svg, "");
7+
byte[] imageByte = images.ImageData;
8+
//Save the image
9+
File.WriteAllBytes(Path.GetFullPath(@"Output/Output.jpg"), imageByte);

0 commit comments

Comments
 (0)