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.
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:
Use the code snippet below for converting PDF to HTML.
//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:
Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/PdfToHtmlOPX1940268788