Articles in this section
Category / Section

How to use WindowStatus in WebKit HTML converter For .NET WebForms PDF?

2 mins read

We can manually wait HtmlConverter up to the document loading using WindowStatus property in WebKit HTML converter. We can use windows status instead of addition delay. In additional delay, we do not know the exact time that need for execution of JavaScript. By windows status you can avoid this problem.


Both window status should be same, else converter never stops the conversion

Assemblies Required




Steps to use WindowStatus in Webkit HTML converter programmatically in c#:

1)Create a new WPF application project.

Create a new WPF application project in WinForms PDF

2)Install the Syncfusion.HtmlToPdfConverter.WPF NuGet package as reference to your .NET Framework applications from

Install NuGet packages in WinForms PDF

3)Include the following namespaces in the MainWindow.xaml.cs file

 using Syncfusion.HtmlConverter;
 using Syncfusion.Pdf; 
 using System.Windows;


Add a new button in MainWindow.xaml to create a PDF document as follows.


<TextBlock TextAlignment="Justify" FontFamily="Verdana" FontSize="11" TextWrapping="Wrap" Padding="5,5,5,5" Margin="0,77,0,1" >
<LinearGradientBrush EndPoint="0.5,-0.04" StartPoint="0.5,1.04">
<GradientStop Color="#FFD9E9F7" Offset="0"/>
<GradientStop Color="#FFEFF8FF" Offset="1"/>
Click the button to view PDF file generated by Essential PDF.
<Button Click="btnCreate_Click" Margin="0,0,10,12" VerticalAlignment="Bottom" Height="30" BorderBrush="LightBlue" HorizontalAlignment="Right" Width="180">
<LinearGradientBrush EndPoint="0.5,-0.04" StartPoint="0.5,1.04">
<GradientStop Color="#FFD9E9F7" Offset="0"/>
<GradientStop Color="#FFEFF8FF" Offset="1"/>
<StackPanel Orientation="Horizontal" Height="23" Margin="0,0,0,-2.52" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="100">
<Image Name="image2" Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBlock Text="Create PDF" Height="15.96" Width="126" Margin="0,4,0,3" />


Add the following code in btnCreate_Click to create a PDF file with simple text.


// Create a HTML to PDF converter object with default settings
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
//Set window status
blinkConverterSettings.WindowStatus = "completed";
htmlConverter.ConverterSettings = blinkConverterSettings;
//Convert url to pdf
PdfDocument document = htmlConverter.Convert("input.html");
//Save the document.



<body >
    <div id="message">
        Wait for 2 Seconds
    <script type="text/javascript">
        setTimeout(function () {
            document.getElementById("message").innerHTML = "Hello World!!";
            window.status = "completed";
        }, 2000);


     A complete working sample can be downloaded from

     By executing the program, you will get the PDF document as follows.

                               WinForms PDF document


 Take a moment to peruse the documentation, where you can find converting HTML pages to PDF document along with respective customization options and features.

 Refer here to explore the rich set of Syncfusion Essential PDF features.

 An online sample link to convert HTML to PDF document.


A new version of Essential Studio for ASP.NET is available. Versions prior to the release of Essential Studio 2014, Volume 2 will now be referred to as a classic versions.The new ASP.NET suite is powered by Essential Studio for JavaScript providing client-side rendering of HTML 5-JavaScript controls, offering better performance, and better support for touch interactivity. The new version includes all the features of the old version, so migration is easy.

The Classic controls can be used in existing projects; however, if you are starting a new project, we recommend using the latest version of Essential Studio for ASP.NET. Although Syncfusion will continue to support all Classic Versions, we are happy to assist you in migrating to the newest edition.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls. If you have any queries or require clarifications, please let us know in the comments section below.

You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment