Skip to content

Commit

Permalink
Merge pull request #69 from SyncfusionExamples/870904
Browse files Browse the repository at this point in the history
870904: Attached timeout support in HTML to PDF sample.
  • Loading branch information
praveenHari24 authored Feb 21, 2024
2 parents e8b1f3d + 926d830 commit 9598dc8
Show file tree
Hide file tree
Showing 3 changed files with 60 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}") = "Time-out-support-in-HTML-to-PDF", "Time-out-support-in-HTML-to-PDF\Time-out-support-in-HTML-to-PDF.csproj", "{94F088F3-3517-4E63-8633-05C71D5BA1E2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{94F088F3-3517-4E63-8633-05C71D5BA1E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94F088F3-3517-4E63-8633-05C71D5BA1E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94F088F3-3517-4E63-8633-05C71D5BA1E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94F088F3-3517-4E63-8633-05C71D5BA1E2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {86ACE6C7-3AD0-4331-B45D-2DF0B5415841}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//Initialize the HTML to PDF converter.
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;

//Initialize the HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
//Initialize the blink converter settings.
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
// Set the conversion timeout to 5000 milliseconds
blinkConverterSettings.ConversionTimeout = 5000;
//Assign Blink converter settings to HTML converter
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.google.com");
//Create a file stream.
FileStream fileStream = new FileStream("HTML-to-PDF.pdf", FileMode.CreateNew, FileAccess.ReadWrite);
//Save and close the PDF document.
document.Save(fileStream);
//Close the document.
document.Close(true);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

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

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

</Project>

0 comments on commit 9598dc8

Please sign in to comment.