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

Trusted by the world’s leading companies

Syncfusion Trusted Companies

HTML to PDF Overview

The HTML-to-PDF converter is a .NET library for converting webpages, SVG, MHTML, and HTML files to PDF using C#. It uses the popular rendering engine Blink (Google Chrome). It is reliable and accurate. The result preserves all graphics, images, text, fonts, and the layout of the original HTML document or webpage.

The HTML-to-PDF converter works seamlessly in various platforms: Azure App Services, Azure Functions, AWS Lambda, Docker, WinForms, WPF, Blazor, ASP.NET MVC, ASP.NET Core with Windows, Linux, and MacOS.

Overview of HTML to PDF for .NET


Convert HTML to PDF using C#

The .NET HTML-to-PDF converter allows converting an HTML file, HTML string, URL, ASPX, Razor, or MVC View to PDF with just a few lines of code.

//Initialize HTML to PDF converter.
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
//Convert URL to PDF document.
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
//Create the filestream to save the PDF document. 
FileStream fileStream = new FileStream("HTML-to-PDF.pdf", FileMode.CreateNew, FileAccess.ReadWrite);
//Save and close the PDF document.
document.Save(fileStream);
document.Close(true);
'Initialize HTML to PDF converter.  
Dim htmlConverter As HtmlToPdfConverter = New HtmlToPdfConverter()
'Convert URL to PDF document.
Dim document As PdfDocument = htmlConverter.Convert("https://www.syncfusion.com")
'Create the filestream to save the PDF document.
Dim fileStream As FileStream = New FileStream("HTML-to-PDF.pdf", FileMode.CreateNew, FileAccess.ReadWrite)
'Save and close the PDF document.
document.Save(fileStream)
document.Close(True)

General information

Powerful and comprehensive APIs

Comprehensive APIs make it possible to convert richly formatted HTML strings or webpages to PDF.

Blazing-fast performance

Optimized for usage in a server environment where speed and low memory usage are critical.

Fully documented

The .NET HTML-to-PDF converter includes extensive documentation, a knowledge base, and samples.


HTML-to-PDF conversion

Convert HTML to PDF files in CSharp.NET.

Convert HTML to PDF files in C#

The .NET HTML-to-PDF converter allows users to convert URLs, HTML5, CSS, CSS3, and HTML to PDF with just five lines of C# code.

Partial webpage HTML to PDF in .NET.

Partial webpage to PDF

A part of a webpage can be converted to PDF based on the HTML tag ID.

Preserve format when converting HTML to PDF in .NET.

Preserve format

The PDF will look just like the converted webpage. It preserves all graphics, images, text, fonts, links, and layout of the original HTML document or webpage.

JavaScript execution in converting HTML to PDF.

JavaScript execution

HTML can be converted to PDF with or without JavaScript execution during conversion.


Hyperlink toggle in converting HTML to PDF in CSharp .NET.

Hyperlinks can be toggled when converting HTML to PDF documents.

Converting HTML form to PDF form in CSharp .NET.

HTML form to PDF form

Convert an HTML form to a PDF form and preserve its exact position, size, and appearance. In addition, preserve the values of the HTML form fields.

Bookmarks created on converting HTML to PDF in .NET.

Bookmarks

Bookmarks are created automatically in a PDF document based on the HTML heading tags from <h1> to <h6>.

Table of contents created on converting HTML to PDF in CSharp .NET.

Table of contents

A table of contents will be created automatically in a PDF document based on the HTML heading tags from <h1> to <h6> with default styles. Also, apply custom styles to the table of contents.


Converting Windows authentication HTML page to PDF.

Windows authentication

Windows-authenticated webpages can be converted to PDF with a username and password in the converter.

Converting form authentication HTML page to PDF.

Form authentication

Form-authenticated webpages can be converted to PDF by using cookies in the converter settings.

Converting HTML page with token-based authentication to PDF.

Token-based authentication

Webpages with token-based authentication can be converted to PDF by using bearer tokens in the converter’s HTTP request header.

HTML to PDF converter supporting media types.

Media types

The .NET HTML-to-PDF converter supports both screen and print media types in conversion using C#.


Viewport customization on converting HTML to PDF.

Viewport customization

Convert HTML to PDF based on the desired viewport size.

Proxy settings available in HTML-to-PDF converter.

Proxy

System and manual proxy settings are available to convert HTML to PDF using C#.

Offline conversion support in HTML-to-PDF converter.

Offline conversion

Convert HTML to PDF with the available offline data by ignoring the online resources.

SVG to PDF support in HTML-to-PDF converter in .NET.

SVG to PDF

SVG files or SVG elements in HTML can also be converted to PDF document.


PRICING

File Formats
Developer Platform
Unlimited Global License

Developer Platform

Essential Studio

$ 2,495

Per developer 1st year

Includes 1,700+ Controls
BEST VALUE

Unlimited Global License

Cover everyone in your organization for one low annual fee

CONTACT US

File Formats

$ 995

Per developer 1st year

DEVELOPER PLATFORM
  • 80+ Components each for JavaScript, Angular, jQuery, React, and Vue.
  • 75+ ASP.NET Web Forms Controls
  • 80+ Blazor Components
  • 80+ ASP.NET MVC Controls
  • 80+ ASP.NET Core Controls
  • File Formats (Word, Excel, PowerPoint and PDF) Tool tip information icon
  • Report Viewer SDK
  • 30+ WinUI Controls
  • 25+ .NET MAUI Controls
  • 155+ Xamarin Controls *Includes iOS, Android and UWP
  • 100+ WinForms Controls
  • 100+ WPF Controls
  • 70+ UWP Controls
  • 60+ PHP Controls
  • 60+ JSP Controls
  • Flutter Widgets
  • Predictive Analytics
SUPPORT
  • Dedicated Account Representative
  • Quarterly product releases
  • Support within 24 hours on all business days
  • Live chat support on all business days
LICENSING
  • Licensing Management Portal
  • Commercial Use
  • Max Developer count
  • 1 per license
  • Coverage Period
  • 1 year
File Formats
Developer Platform
Unlimited Global License

RESOURCES

CASE STUDY

Syncfusion’s file format components helped me create the reports I needed, fast. – J. Pereira, Software Developer.

The libraries have been built from scratch and refined for more than a decade to provide blazing-fast performance, comprehensive API, and compatibility across the latest and older versions of these files.

CONTINUE READING View all Customer Stories

VIDEOS

Syncfusion File Format Libraries - Manipulate Excel, Word, PowerPoint, and PDF files

Read and write Excel, Word, PDF, and PowerPoint files. Also includes integrated visualization capabilities. Advanced features include support for pivot tables, pivot charts, mail-merge, and extensive formatting.

E-BOOK

Succinctly Series: Statistics Using Excel Succinctly

Succinctly Series: Statistics Using Excel Succinctly


- by Charles Zaiontz
CONTINUE READING View all E-books

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.

Scroll up 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
Live Chat Icon