-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from SyncfusionExamples/870904
870904: Attached timeout support in HTML to PDF sample.
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
HTML to PDF/Blink/Time-out-support-in-HTML-to-PDF/.NET/Time-out-support-in-HTML-to-PDF.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
20 changes: 20 additions & 0 deletions
20
...PDF/Blink/Time-out-support-in-HTML-to-PDF/.NET/Time-out-support-in-HTML-to-PDF/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
15 changes: 15 additions & 0 deletions
15
...n-HTML-to-PDF/.NET/Time-out-support-in-HTML-to-PDF/Time-out-support-in-HTML-to-PDF.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |