HTML to PDF SDK Library

Add HTML format capabilities to your document imaging applications by a HTML to PDF SDK.

View, manage and convert to PDF HTML files, web pages, and email documents. Render images, CSS, forms, hyperlinks, and JavaScript in your PDF documents.
The GdPicture.NET converter supports HTML conversion from a string, file, or URL and offers many options to control page size and formatting.

Trusted since 15+ years, by 3000+ and Fortune500 companies, and 10K+ developers.

HTML support

Main Features of the HTML to PDF SDK Library

Settings

Use Cases of a HTML to PDF SDK Library

Here are a few examples of how to use HTML support in your applications.

Screenshots of online HTML documentation converted to PDF.

HTML support in GdPicture.NET

A browser is required to support HTML content as input into the whole toolkit scope.
Our HTML support currently uses Chrome’s rendering engine and Edge to display your document with the highest accuracy, whether Chrome is installed on the machine or not.

If Chrome or Edge is already installed on your machine, no action on your part is necessary.

If it’s not the case, you have two choices to make it work with Chrome:

1. Install Google Chrome Portable in the installation folder. You can download Google Chrome Portable here.

2. Set the path of the chrome.exe portable version with the SetWebBrowserPath() method.

HTML to PDF SDK Format Viewer

The DocuVieware demo below shows how HTML files can be integrated into existing content.

How to use

Download and install GdPicture.NET package from here.

You will find a compiled demo applications in [Install directory]\Samples\Bin\

You will find an example of a full application in [Install directory]\Samples\DotNet\GdPicture.NET 14\

Find other code snippets within the online reference guide found here

FAQs

The SDK provides comprehensive features, including:

  • HTML Viewing: Render HTML files, web pages, and email documents within applications.
  • Conversion to PDF: Transform HTML content into PDF documents, preserving layouts and styles.
  • Support for Web Technologies: Accurately process and render images, CSS, JavaScript, forms, and hyperlinks within HTML content.
  • Flexible Input Sources: Convert HTML from strings, files, or URLs, offering versatility in handling various HTML content sources.
  • Customization Options: Control page size, margins, and formatting to tailor the output PDF to specific requirements.

These features enable the integration of dynamic HTML content into PDF workflows, enhancing document management and presentation.

Yes, the SDK utilizes Chrome’s rendering engine to ensure high-fidelity HTML processing. If Chrome or Edge is installed on the machine, the SDK will automatically utilize it. If not, developers can:

  • Install Google Chrome Portable: Place it in the application’s installation directory.
  • Specify the Browser Path: Use the SetWebBrowserPath() method to define the path to the Chrome executable.

This setup ensures consistent and accurate rendering of HTML content.

Absolutely. The GdPicture.NET HTML to PDF SDK fully supports the execution of JavaScript, enabling accurate rendering of dynamic and interactive web content within the converted PDF. This ensures that elements such as client-side scripts and dynamic data are faithfully reproduced in the output document.

The SDK offers extensive customization capabilities, allowing developers to:

  • Set Page Dimensions: Define custom page widths and heights to match specific layout requirements.
  • Adjust Margins: Specify top, bottom, left, and right margins to control content positioning.
  • Emulate Media Types: Choose between screen or print media types to influence CSS application and rendering styles.
  • Control Pagination: Opt to fit content into a single page or distribute it across multiple pages as needed.

These options provide flexibility to tailor the PDF output to diverse application needs.

Yes, the SDK is designed with performance in mind. It supports the management of a pool of browser instances, which can be configured to optimize processing speed and resource utilization. This feature is particularly beneficial for applications requiring the conversion of multiple HTML documents concurrently, ensuring efficient and rapid processing.

Check our other supported formats

Try GdPicture.NET Now!

60-day free trial