> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/cli/pdf2html/pdf2html.md).

# Convert PDF to HTML via Command Line for Windows, Linux, macOS

Apryse's PDF2HTML is an easy-to-use, stand-alone command-line application that provides users with an efficient means of converting PDF documents to HTML files for Linux, Windows and Mac.

Apryse's **PDF2HTML** is an easy-to-use, stand-alone command-line application that provides users with an efficient means of converting PDF documents to HTML files for Linux, Windows and Mac. PDF2HTML exports high quality HTML that authentically maintains the contents of the original PDF.

<a href="/cli/get-started/download.md" class="button primary">Download PDF2HTML</a>

{% hint style="info" %}
Need to pull more data from your pdf? Server SDK also features intelligent data extraction with tools such as [Smart Data Extraction](/core/smart-data-extraction/document-structure.md).
{% endhint %}

Like other Apryse products, PDF2HTML does not rely on any other third-party software. PDF2HTML can be used in server environments or as a batch conversion process.

<a href="/core/conversion/conversion.md" class="button primary">SDK Guide</a>

## Why PDF2HTML?

PDF2HTML is easy to use and reliably preserves the contents of the PDF in the HTML output. PDF fonts are mapped to the appropriate system fonts with style, size and kerning to make accurate fit. PDF tables with and without PDF table structures are detected and converted to HTML tables automatically. Single and multi-column pages are converted to equivalent structures with text flow preserved to facilitate editing. Graphics are converted authentically and placed accurately on the page.

PDF2HTML can be used in server environments and is also suitable for use in batch conversion workflows.

## **Key Functions**

* Convert PDF to HTML and HTM.
* Support for all versions of Acrobat documents.
* Support for Unicode and all PDF font formats.
* Support for password-protected PDF.
* Batch conversion.
* Options to improve text readability and layout.
* Automatically converts to structured content.
* Option to convert specific page ranges.
* Options to control image quality.
* Options to handle OCRed PDFs.

## **Common Use Case Scenarios**

* Simple conversion of PDF to HTML for Web posting.
* Server-based, on-demand conversion of PDF documents to HTML format.
* Batch processing of PDF files for data collection.

## **Operating Systems Supported**

* Windows, Linux and Mac.

## **System Requirements**

* At least 30 MB of free disk space.
* Memory requirement is dependent on the source document being converted. We recommend a minimum of 4 GB.

## Example

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
#!/bin/sh
echo "Example 1) Convert myIn.pdf in this folder to myOut.html using default options:"
./pdf2html -in myIn.pdf -out myOut.html -license PDFTRON_LICENSE_KEY
```

{% endcode %}
{% endtab %}
{% endtabs %}

## More PDF to HTML tools

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](/web/what-is-webviewer/overview.md) To convert PDF to HTML canvas in real-time client-side.

[PDF to HTML/ePub](/core/conversion/convert-pdf.md) To convert PDF to fixed layout HTML/ePub where one PDF page becomes one HTML file.

[PDF2SVG](/core/conversion/convert-pdf.md) To convert PDF to SVG to create a vector based image that can be embedded in an HTML file.

[PDF2Image](/core/create/thumbnail.md) 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](/cli/pdf2html/pdf2html.md) To convert PDF to a single HTML file that preserves the PDF content using a custom heuristic method.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/cli/pdf2html/pdf2html.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
