xinyu zhang Xinyu is a member of the web development, support, and marketing team at IDRsolutions.

How to convert PDF to HTML in C#

1 min read

PDF forms to HTML forms using Java (Icon)

PDF to HTML using Java (Icon)

In this article I will show you how you can use our PDF files to HTML API and generate HTML from PDF with our library BuildVu. BuildVu is the best PDF to HTML conversion tool for developers. PDF to HTML conversion helps you to optimise your PDF content for display on browsers. We have a separate article explaining the benefits of converting PDF to HTML.

 

Convert PDF to HTML using C#

Although the aforementioned services can be accessed using plain HTTP requests, this tutorial utilizes our open-source C# IDRCloudClient, which offers a straightforward C# wrapper around the REST API.

Prerequisites

To install the idrsolutions-csharp-client package using NuGet, run the following command:

Code Example

Here is a basic code example for converting PDF files to HTML or SVG. Detailed configuration options and advanced features are provided below.

Return result to a callback url

The BuildVu Microservice supports a callback URL to notify you on the status of conversion completion. Using a callback URL eliminates the need to poll the service to check when the conversion is complete.

The callback URL can be provided to the convert method as demonstrated below:

Configuration Options

The BuildVu API allows for conversion customization using a stringified JSON object with key-value pairs. These settings should be added to the parameters array. A comprehensive list of configuration options for converting PDF files to HTML or SVG is available here.

Upload by URL

In addition to uploading a local file, you can provide a URL for the BuildVu Microservice to download and convert. Replace the input and file values in the parameters variable with the following settings.

Using Authentication

If you’ve deployed your own BuildVu Microservice that requires a username and password for converting PDF files to HTML or SVG, you must provide these credentials for each conversion. Pass two variables named username and password to the convert

Using the approaches described above, you can efficiently generate HTML from PDF documents in your C# applications with BuildVu.



BuildVu allows you to

View PDF files in a Web app
Convert PDF documents to HTML5
Parse PDF documents as HTML
xinyu zhang Xinyu is a member of the web development, support, and marketing team at IDRsolutions.