1. Products
  2.   HTML Converter

HTML Converter for .NET

Convert between PDF and HTML formats with Documentize .NET Plugin to enhance document accessibility and versatility.

HTML Converter for .NET

The Documentize HTML Converter for .NET provides robust, bi-directional conversion between PDF and HTML formats. Whether you need to make PDF content web-accessible or generate high-quality PDFs from HTML, this converter offers a seamless solution.

With options to embed resources or store them separately, the converter enables flexibility across web applications, archival systems, and report generation. Ideal for organizations and developers looking to streamline document transformations, Documentize HTML Converter integrates effortlessly into .NET environments for easy setup and reliable performance.

How to Convert PDF to HTML via .NET

  • Add Documentize to your project as a reference.
  • Initialize a HtmlConverter instance to start the process.
  • Configure PdfToHtmlOptions to set up conversion preferences such as embedded or external resources.
  • Specify input and output paths for the PDF and resulting HTML file.
  • Call Process method on HtmlConverter with the configured options.
  • The PDF will be converted to HTML as specified in the output path.

Why Choose Embedded Resources?

When converting PDFs to HTML, PdfToHtmlOptions allows you to choose between embedded or external resources. Embedded resources keep all assets within a single HTML file, making it ideal for offline use or standalone viewing. External resources reduce the HTML file size, which is useful for web-based applications where resources can be loaded separately, enhancing performance.


How to Convert HTML to PDF via .NET

  • Add Documentize to your project as a reference.
  • Create a HtmlConverter instance to handle the conversion.
  • Set up HtmlToPdfOptions to define layout preferences and page adjustments.
  • Add input and output paths for the HTML file and output PDF.
  • Call Process on HtmlConverter to begin the transformation.
  • The HTML will be converted to PDF and saved to the specified output path.

Optimizing Layout for PDFs

The HtmlToPdfOptions allows you to control the layout of your PDF output, including options for PageLayoutOption and HtmlMediaType. Set PageLayoutOption to fit content to the PDF page width or maintain original HTML layout for complex designs. For print-ready PDFs, use HtmlMediaType.Print to apply print-specific styles, ensuring that the final output matches your formatting needs.


Frequently Asked Questions

What formats can I convert with the HTML Converter?

The HTML Converter for .NET allows conversions between PDF and HTML formats, ensuring both formats are accessible across web and print applications.

How can I control resource handling in PDF to HTML conversion?

You can choose to embed resources within the HTML file or store them externally, depending on your use case. Embedded resources are useful for offline access, while external resources are better for web applications.

Is it possible to fit HTML content to a single-page PDF?

Yes, the IsRenderToSinglePage option within HtmlToPdfOptions allows rendering all HTML content on a single PDF page, which is ideal for presentations or condensed reports.

Can I use print styles when converting HTML to PDF?

Absolutely. You can set HtmlMediaType to Print, which applies print-specific CSS styles, allowing you to create print-ready PDF documents from your HTML files.