Skip to content

Commit

Permalink
865893 : Add scale property in HTML converter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sri-hari-haran-g committed Jan 11, 2024
1 parent be13356 commit 4efcbce
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Scale_property_in_HTML_converter", "Scale_property_in_HTML_converter\Scale_property_in_HTML_converter.csproj", "{DF049042-5B7C-4589-83BE-46451D5B7932}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DF049042-5B7C-4589-83BE-46451D5B7932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF049042-5B7C-4589-83BE-46451D5B7932}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF049042-5B7C-4589-83BE-46451D5B7932}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF049042-5B7C-4589-83BE-46451D5B7932}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {86A1E28F-2A87-4324-A248-4F416B31440C}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
//Initialize blink converter settings.
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set the Scale.
blinkConverterSettings.Scale = 1.0f;
//Assign Blink converter settings to HTML converter.
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
//Create a file stream.
FileStream fileStream = new FileStream("HTMLtoPDF.pdf", FileMode.Create, FileAccess.ReadWrite);
//Save a PDF document to a file stream.
document.Save(fileStream);
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<ItemGroup>
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Windows" Version="24.1.45" />
</ItemGroup>

</Project>

0 comments on commit 4efcbce

Please sign in to comment.