We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Syncfusion Feedback

Convert PDF to HTML OPX

Introduction

Syncfusion now supports PDF-to-HTML conversion with the use of XPDF. XPDF is an open source viewer library for PDF document, and we have customized it to support converting PDF to HTML.

The Syncfusion PDF-to-HTML converter supports preserving HTML content as flow layout (relative positioning), and we have made improvements in preserving images during the conversion.

Assemblies Required

To use the PDF-to-HTML conversion in applications, references need to be added to the following set of assemblies:

Assembly Name

Description

Syncfusion.Pdf.Base This assembly contains the core feature for manipulating and saving PDF documents.
Syncfusion.Compression.Base This assembly compresses the internal contents of a PDF document.
Syncfusion.PdfToHtmlConverter.OPX
Syncfusion.PdfToHtmlWrapper

The following namespaces should be added in the application:

  • using Syncfusion.PdfToHtmlConverter;
  • using Syncfusion.Pdf.Parsing;

Use the code snippet below for converting PDF to HTML.

  • c#
  • //Initializing PdfToHtmlConverter
    PdfToHtmlConverter converter = new PdfToHtmlConverter();
    //Initializing and applying settings
    PdfToHtmlConverterSettings setting = new PdfToHtmlConverterSettings();
    setting.IsFrame = false;
    setting.AbsolutePositioning = false;
    converter.Settings = setting;
    //Loading the input PDF document.
    PdfLoadedDocument ldoc = new PdfLoadedDocument(txtImageFile.Text);
    //Converting PDF to HTML
    converter.Convert(inputPath, outputPath, ldoc.Pages.Count);
    ldoc.Close(true);

    Sample Output:

    XPDF-Viewer Library for PDF Document Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfToHtmlOPX1940268788