How to Convert PDF to HTML using C++

This brief example focuses on how to Convert PDF to HTML using C++. One can easily export PDF to HTML in C++ by utilizing simple API calls without any dependence on any third party API or Adobe Acrobat tool. You may use the application in any of C++ supported application running in Windows or Linux operation systems.

Steps to Convert PDF to HTML using C++

  1. Install Aspose.Pdf for C++ using NuGet package manager in your application
  2. Include a reference to Aspose::Pdf namespace and add required header files
  3. Create Document Class object to load source PDF file
  4. Create HtmlSaveOptions Class object to set desired HTML export options
  5. Finally, by using Save method convert PDF to HTML in C++

In C++ PDF to HTML conversion is easily managed by using simple API calls. We will start with configuration of project by adding the API reference using Nuget package manager and including the required header files. Then we will load the source PDF and set export options for desired HTML using HtmlSaveOptions class. Finally, the rendered HTML can be saved on disk or may be used further in your application.

Code to Convert PDF to HTML using C++

The aforementioned sample in C++ convert PDF to HTML by using different properties exposed by HtmlSaveOptions class. You can set properties related to fonts, images and SVG content export options to customize the exported HTML. Finally, the generated HTML file can be saved either on disk or in MemoryStream for further usage.

In this topic, we have learnt to convert PDF to HTML in C++ and obtaining a customized output. If you are interested in creating PDF from scratch, refer to the article on how to create PDF using C++.

 English