Some test text!

Loading...
Guides
PDF to HTML

Convert PDF to HTML in PHP

There are two HTML conversion modules and one of them is an optional Add-on.

Fixed position
The built-in HTML module is used to convert PDF documents to fixed-position HTML documents.

Reflow paragraphs
The optional PDF2HtmlReflowParagraphsModule add-on module is used to convert PDF documents to HTML documents with text reflowing within paragraphs.

Convert with fixed positioning

To convert PDF Documents to HTML format with fixed positioning.

// Convert PDF document to HTML with fixed positioning option turned on (default)
Convert::ToHtml($filename, $output_filename);

PDF Converter (SVG, XPS, TIFF, JPG, RTF, TXT, More)
Full sample code which shows how to use PDFNet Convert for direct, high-quality conversion between PDF, XPS, EMF, SVG, TIFF, PNG, JPEG, and other image formats.

Convert with reflow paragraphs

To convert PDF Documents to HTML format with reflow paragraphs.

The HTML reflow paragraphs module is an optional add-on
Only available on Desktop and Server (Windows, Linux, or Mac)
You can find more details about how to install PDF2HTML reflow paragraph module here .
$htmlOutputOptions = new HTMLOutputOptions();

// Set e_reflow_paragraphs content reflow setting
$htmlOutputOptions->SetContentReflowSetting(HTMLOutputOptions::e_reflow_paragraphs);

// Optionally set to flow paragraphs across the entire browser window.
$htmlOutputOptions->SetNoPageWidth(true);

// Convert PDF document to HTML with reflow paragraphs option turned on
// But requires the PDF2HtmlReflowParagraphsModule
Convert::ToHtml($filename, $output_filename, htmlOutputOptions);

Convert PDF to HTML
Full sample code which shows how to convert generic PDF documents to HTML format

About PDF to HTML

Depending on your use case, PDF to HTML can be used for rendering with high fidelity and accuracy or to primarily be used in content extraction. This means our tools can help you to display the output or be used in data analysis workflows.

Here are the different options for PDF to HTML conversion depending on your requirements:

PDF to HTML for the highest rendering accuracy

Here are the options for maintaining the original PDF layout and visual accuracy.

WebViewer
To convert PDF to HTML canvas in real-time client-side.

PDF to HTML/ePub
To convert PDF to fixed layout HTML/ePub where one PDF page becomes one HTML file.

PDF2SVG
To convert PDF to SVG to create a vector based image that can be embedded in an HTML file.

PDF2Image
To convert PDF to Image (PNG, JPG, TIFF, Raw) to create a raster based image that can be embedded in an HTML file.

PDF to HTML for extracting semantic content

Here are the options for extracting semantic content from the output.

PDF2HTML
To convert PDF to a single HTML file that preserves the PDF content using a custom heuristic method.

PDFTron.AI
To convert PDF to HTML where tables are identified using a custom deep learning model.

Get the answers you need: Support