Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Free HTML to PDF .NET and C# Library for ASP.NET MVC
Free HTML to PDF .NET and C# Library for ASP.NET MVC

Free HTML to PDF .NET and C# Library for ASP.NET MVC

HiQPdf

|
5,027 clicks
| (2) | Free
Free HTML to PDF Converter for .NET is a fast method to easily create richly-formatted PDF documents. Free HTML to PDF Converter Library for .NET is the limited free version of the HiQPdf HTML to PDF
Get Started

The Free HTML to PDF Converter for .NET from HiQPdf Software is a fast method to easily create richly-formatted PDF documents directly from HTML pages or HTML strings. The majority of the websites are already able to produce reports or to present various results in HTML pages but while the HTML content is simple to generate, edit and display it is not suitable for printing or for transmission by email. The Free HTML to PDF Converter for .NET can accurately convert HTML pages to PDF documents in your ASP.NET websites and .NET desktop applications.

Free HTML to PDF Converter Library for .NET is the limited free version of the fully featured HiQPdf HTML to PDF Library for .NET from HiQPdf Software. With Free HTML to PDF Converter Library for .NET you can create maximum 3 PDF pages of high quality content for free.

If you want to create larger unlimited PDF documents or you if you need advanced features like live URLs, internal links, outlines, table of contents, headers and footers, PDF forms, edit, merge and split PDF documents, extract text and images from PDF or PDF pages rasterization you can use the full version of the software.

Free HTML to PDF Converter for .NET Features

  • Convert HTML and HTML5 Documents and Web Pages to PDF
  • Convert URLs and HTML Strings to PDF Files or Memory Buffers
  • Set the PDF Page Size and Orientation
  • Fit HTML Content in PDF Page Size
  • Advanced Support for Web Fonts in .WOFF and .TTF Formats
  • Advanced Support for Scalar Vector Graphics (SVG)
  • Advanced Support for HTML5 and CSS3
  • Delayed Conversion Triggering Mode
  • Control PDF page breaks with page-break CSS attributes in HTML
  • Repeat HTML Table Header and Footer on Each PDF Page
  • Packaged and Delivered as a Zip Archive
  • No External Dependencies
  • Direct Copy Deployment Supported
  • ASP.NET and Windows Forms Samples, Complete Documentation
  • Supported on All Windows Versions
  • Create for Free Maximum 3 Pages of High Quality PDF Content

C# Code Sample for ASP.NET

This sample shows how easy you can create the PDF documents from existing HTML pages or HTML strings. The HTML page containing HTML5 code, CSS3, JavaScript or SVG. With just a few lines of code you can get richly formatted PDF document. In this example you can see how to set simple parameters like the PDF page size, orientation and margins, convert the HTML code or URL to PDF and download the resulted PDF in a browser as attachment or inline.

// create the HTML to PDF converterHtmlToPdf htmlToPdfConverter = new HtmlToPdf();// set PDF page size and orientationhtmlToPdfConverter.Document.PageSize = GetSelectedPageSize();htmlToPdfConverter.Document.PageOrientation = GetSelectedPageOrientation();// set PDF page marginshtmlToPdfConverter.Document.Margins = new PdfMargins(0);// convert HTML to PDFbyte[] pdfBuffer = null;if (radioButtonConvertUrl.Checked){    // convert URL to a PDF memory buffer    string url = textBoxUrl.Text;    pdfBuffer = htmlToPdfConverter.ConvertUrlToMemory(url);}else{    // convert HTML code    string htmlCode = textBoxHtmlCode.Text;    string baseUrl = textBoxBaseUrl.Text;    // convert HTML code to a PDF memory buffer    pdfBuffer = htmlToPdfConverter.ConvertHtmlToMemory(htmlCode, baseUrl);}// inform the browser about the binary data formatHttpContext.Current.Response.AddHeader("Content-Type", "application/pdf");// set how to open the PDF document, attachment or inline, and the file nameHttpContext.Current.Response.AddHeader("Content-Disposition",     String.Format("{0}; filename=HtmlToPdf.pdf; size={1}",    checkBoxOpenInline.Checked ? "inline" : "attachment",     pdfBuffer.Length.ToString()));// write the PDF buffer to HTTP responseHttpContext.Current.Response.BinaryWrite(pdfBuffer);// call End() method of HTTP response to stop ASP.NET page processingHttpContext.Current.Response.End();

More Information

For more HTML to PDF Conversion features see the Full Version of HiQPdf HTML to PDF Converter for .NET and the Online HTML to PDF Converter Documentation  

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft