Articles in this section
Category / Section

How to use WindowStatus in WebKit HTML converter for WinForms 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.


I hope you enjoyed learning about how to get formatting date value based on culture in C#, VB.NET.

You can refer to our WinForms PDF’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms PDF documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms 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 WinForms PDF and other WinForms components.

If you have any queries or require clarifications, please let us know in comments 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