We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to publish HTML to PDF converter to server using WebKit HTML converter

Platform: ASP.NET MVC |
Control: PDF

Converting HTML to PDF in Web application from scratch using WebKit HTML converter. This documentation contains three sections:

  • HTML to PDF conversion in local machine.
  • Publishing the project to server.
  • Troubleshooting the conversion failure in server.

Assemblies Required

  • Syncfusion.Compression.Base.dll
  • Syncfusion.HtmlConverter.Base.dll
  • Syncfusion.Pdf.Base.dll
  • QtBinaries folder

You can get all these assemblies by installing the WebKit installer in the following link.

WebKit HTML Converter: https://www.syncfusion.com/downloadslatest-version

HTML to PDF conversion in local machine

  1. Create a new ASP.NET MVC project. Create ASP.NET Web application
  2. Copy the required assemblies and QtBinaries from the WebKit installed location to project folder. Copy Assemblies and QtBinaries
  3. Refer the copied assemblies in the project by using reference manager. Refer Copied Assemblies
  4. Include the QtBinaries folder in the project and set Copy to Output Directory as Copy always for all files in the QtBinaries folder. Include Project Copy to output directory
  5. Add button to export the web page to PDF in index.cshtml and add the following code snippet in controller. Add Button


public ActionResult ExportToPDF()
//Initialize HTML to PDF converter 
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = Server.MapPath("~/QtBinaries/");
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert(Request.Url.Authority);
MemoryStream stream = new MemoryStream();
//Save and return the PDF file
return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "Sample.pdf");


  1. Run the project and test the HTML conversion in local computer.

Publishing the project to server

  1. Publish the project to a local file folder. Publish the project Pick a Publish target
  2. It will publish the required files to the local publish folder. Published files location
  3. Copy the published output folder to the server and host the application in IIS.
  1. Open the IIS manager in the server and add new website.
  2. Provide site name and select the physical path of the published output folder on the server. Fill published details on server
  3. Get the IP address of the server after adding the website in local IIS server.
  4. Browse the website using the IP address and port number from the local computer. Once the website is loaded, export the webpage to PDF. Published website Published Website


Troubleshooting the conversion failure in server

Refer to the following links for troubleshooting the conversion failure in the server.

UG: https://help.syncfusion.com/file-formats/pdf/converting-html-to-pdf#troubleshooting 

KB: https://www.syncfusion.com/kb/8208/failed-to-convert-the-webpage-exception-with-webkit-html-converter



2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile