HTML JPG PDF XML CGM
  Product Family
BMP

Convert PDF to HTML via C#

Native and high-performance PDF file creation without Adobe Acrobat installation using C#.

How to Convert PDF to HTML Using C#

In order to convert PDF to HTML, we’ll use Aspose.PDF for C++ API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C++ platform. Open NuGet package manager, search for Aspose.PDF and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command


PM> Install-Package Aspose.PDF

Dependency

<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-pdf</artifactId>
<version>version of aspose-pdf API</version>
<classifier>jdk17</classifier>
</dependency>

Steps to Convert PDF to HTML via C#

.NET developers can easily load & convert PDF files to HTML in just a few lines of code.

  1. Add namespace in relevant class
  2. Initialize a new Document
  3. Call the Document.Save method while passing the output file path & SaveFormat.Html as parameters
  4. Finally, save the output HTML file

System Requirements

Aspose.PDF for .NETis supported on all major operating systems. Just make sure that you have the following prerequisites.

 

 

This sample code shows PDF to HTML C# Conversion

        public static void ConvertPDFtoHTML()
        {
            // load PDF with an instance of Document                        
            var document = new Document("template.pdf");

            // save document in HTML format
            document.Save("output.html", Aspose.Pdf.SaveFormat.Html);
        }
 
  • Convert PDF to HTML via Online App