Skip to main content

HTML to PDF Byte Array

Version: 3.0

Convert HTML to PDF Byte Arrays

Easily convert HTML to a PDF byte array using DynamicPDF HTML Converter for .NET. The following C# example shows you how.

How to Convert HTML to PDF Byte Array in C#​

The following steps and C# sample code illustrate converting HTML to a PDF byte array using DynamicPDF HTML Converter for .NET.

Steps for Creating a PDF Document from HTML​

  1. Add a using statement for ceTe.DynamicPDF.HtmlConverter.
  2. Invoke the Convert method on the HtmlConverter and specify the PDF file name.

Sample Code - C#​

//be certain to use ceTe.DynamicPDF.HtmlConverter
byte[] pdfByteArray = Converter.Convert(new Uri("https://www.google.com"));
File.WriteAllBytes("ConvertToByteArray.pdf", pdfByteArray);

GitHub Project​

Examples are provided in C# and VB.NET. Clone or view the example project at GitHub.

View source on GitHub: DynamicPDF HTML Converter Example Project

Getting Started​

Get started easily by installing DynamicPDF HTML Converter for .NET through NuGet or manually. Then, refer to the documentation for more information on using and purchasing.

NuGet Package​

DynamicPDF HTML Converter for .NET is available on NuGet in the ceTe.DynamicPDF.HtmlConverter.NET package. The easiest way to install the package is through the Visual Studio Package Manager. You can also download directly from NuGet.

Get ceTe.DynamicPDF.HtmlConverter.NET from NuGet

More Information​

Refer to the HTML to PDF Conversion documentation topic for more information.

Documentation version