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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to convert HTML to PDF in ASP.NET Core Windows

Syncfusion HTML to PDF for .NET used to convert webpages, SVG, MHTML, and HTML to PDF. Using this library, you can convert HTML to PDF in ASP.NET Core Windows.

Steps to convert HTML to PDF in ASP.NET Core Windows programmatically:

  1. Create a new ASP.NET Core MVC application.

  1. Install the Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core NuGet package as reference to your .NET Core application from NuGet.org

  1. Copy the QtBinariesWindows folder from the installed HtmltoPdfConverter package and paste it into the folder, which contains the HTMLtoPDF_Windows.csproj file.


  1. Then, set Copy to output directory to copy all the QtBinariesWindows (all files including inner folders and files) assemblies.

  1. Add an Export To PDF button in index.cshtml.

  1. Include the following namespaces and code snippet for converting HTML to PDF in ASP.NET Core Windows.


  1. Build and run the application, the website will open in the browser, then, you can export HTML to PDF.
  2. By exporting HTML to PDF, you will get the PDF document as follows.

A complete working sample can be downloaded from HTMLtoPDF_Windows.zip

Take a moment to peruse the documentation for Converting HTML to PDF, where you will find various options for URL to PDF, HTML string to PDF, and hyperlinks.

Article ID: Published Date: Last Revised Date: Platform: Control:
8483 02/23/2018 12/05/2018 ASP.NET Core PDF
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

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

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