> 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/reusable-content/guides/guides-features-conversion-convertpdf2html.md).

# guides/features/conversion/convertPDF2HTML

There are two HTML conversion modules.

[Fixed position](#convert-with-fixed-positioning) The built-in HTML module is used to convert PDF documents to fixed-position HTML documents.

[Full reflow](#convert-with-full-reflow) To convert PDF Documents to HTML format with full reflow. This module is an optional add-on.

### Convert with fixed positioning

To convert PDF Documents to HTML format with fixed positioning.

{% tabs %}
{% tab title="C#" %}

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

{% endtab %}

{% tab title="C++" %}

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

{% endtab %}

{% tab title="Go" %}

```go
// Convert PDF document to HTML with fixed positioning option turned on (default)
ConvertToHtml(filename, output_filename)
```

{% endtab %}

{% tab title="Java" %}

```java
// Convert PDF document to HTML with fixed positioning option turned on (default)
Convert.toHtml(filename, output_filename);
```

{% endtab %}

{% tab title="JavaScript" %}

```js
async function main() {
  // Convert PDF document to HTML with fixed positioning option turned on (default)
  await PDFNet.Convert.fileToHtml(filename, output_filename);
}
PDFNet.runWithCleanup(main);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Convert PDF document to HTML with fixed positioning option turned on (default)
Convert.toHtml(filename, output_filename)
```

{% endtab %}

{% tab title="Obj-C" %}

```objc
// Convert PDF document to HTML with fixed positioning option turned on (default)
[PTConvert ToHtmlWithFilename:filename out_filename:output_filename options:nil];
```

{% endtab %}

{% tab title="PHP" %}

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

{% endtab %}

{% tab title="Python" %}

```python
# Convert PDF document to HTML with fixed positioning option turned on (default)
Convert.ToHtml(filename, output_filename)
```

{% endtab %}

{% tab title="Swift" %}

```swift
// Convert PDF document to HTML with fixed positioning option turned on (default)
Convert.toHtml(withFilename:filename, out_filename:output_filename options:nil);
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
# Convert PDF document to HTML with fixed positioning option turned on (default)
Convert.toHtml(filename, output_filename)
```

{% endtab %}

{% tab title="VB" %}

```vb
' Convert PDF document to HTML with fixed positioning option turned on (default)
Convert.ToHtml(filename, output_filename)
```

{% endtab %}
{% endtabs %}

[PDF Converter (SVG, XPS, TIFF, JPG, RTF, TXT, More)](/xamarin/samples/run-samples.md#convert) 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. Samples provided in Python, C#, C++, Java, node.js (JavaScript), Go, PHP, VB, Objective-C, Swift and Kotlin.

### Convert with full reflow

To convert PDF Documents to HTML format with full reflow.

{% hint style="warning" %}
\*\* The Structured Output 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 the Structured Output module](/core/learn-more/modules.md#structured-output-module).
{% endhint %}

{% tabs %}
{% tab title="C#" %}

```csharp
Convert.HTMLOutputOptions htmlOutputOptions = new Convert.HTMLOutputOptions();
// Set e_reflow_full content reflow setting
htmlOutputOptions.SetContentReflowSetting(Convert.HTMLOutputOptions.ContentReflowSetting.e_reflow_full);
// Convert PDF document to HTML with full reflow option turned on
// But requires the Structured Output module
Convert.ToHtml(filename, output_filename, htmlOutputOptions);
```

{% endtab %}

{% tab title="C++" %}

```cpp
Convert::HTMLOutputOptions htmlOutputOptions;
// Set e_reflow_full content reflow setting
htmlOutputOptions.SetContentReflowSetting(Convert::HTMLOutputOptions::e_reflow_full);
// Convert PDF document to HTML with full reflow option turned on
// But requires the Structured Output module
Convert::ToHtml(filename, output_filename, htmlOutputOptions);
```

{% endtab %}

{% tab title="Go" %}

```go
htmlOutputOptions := NewHTMLOutputOptions()
// Set e_reflow_full content reflow setting
htmlOutputOptions.SetContentReflowSetting(HTMLOutputOptionsE_reflow_full);
// Convert PDF document to HTML with full reflow option turned on
// But requires the Structured Output module
ConvertToHtml(filename, output_filename, htmlOutputOptions)
```

{% endtab %}

{% tab title="Java" %}

```java
Convert.HTMLOutputOptions htmlOutputOptions = new Convert.HTMLOutputOptions();
// Set e_reflow_full content reflow setting
htmlOutputOptions.setContentReflowSetting(Convert.HTMLOutputOptions.e_reflow_full);
// Convert PDF document to HTML with full reflow option turned on
// But requires the Structured Output module
Convert.toHtml(filename, output_filename, htmlOutputOptions);
```

{% endtab %}

{% tab title="JavaScript" %}

```js
async function main() {
  const htmlOutputOptions = new PDFNet.Convert.HTMLOutputOptions();
  // Set e_reflow_full content reflow setting
  htmlOutputOptions.setContentReflowSetting(PDFNet.Convert.HTMLOutputOptions.ContentReflowSetting.e_reflow_full);
  // Convert PDF document to HTML with full reflow option turned on
  // But requires the Structured Output module
  await PDFNet.Convert.fileToHtml(filename, output_filename, htmlOutputOptions);
}
PDFNet.runWithCleanup(main);
```

{% endtab %}

{% tab title="PHP" %}

```php
$htmlOutputOptions = new HTMLOutputOptions();
// Set e_reflow_full content reflow setting
$htmlOutputOptions->SetContentReflowSetting(HTMLOutputOptions::e_reflow_full);
// Convert PDF document to HTML with full reflow option turned on
// But requires the Structured Output module
Convert::ToHtml($filename, $output_filename, htmlOutputOptions);
```

{% endtab %}

{% tab title="Python" %}

```python
htmlOutputOptions = HTMLOutputOptions()
# Set e_reflow_full content reflow setting
htmlOutputOptions.SetContentReflowSetting(HTMLOutputOptions.e_reflow_full)
# Convert PDF document to HTML with full reflow option turned on
# But requires the Structured Output module
Convert.ToHtml(filename, output_filename, htmlOutputOptions)
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
$htmlOutputOptions = Convert::HTMLOutputOptions.new()
# Set e_reflow_full content reflow setting
$htmlOutputOptions.SetContentReflowSetting(Convert::HTMLOutputOptions::E_reflow_full)
# Convert PDF document to HTML with full reflow option turned on
# But requires the Structured Output module
Convert.toHtml(filename, output_filename, $htmlOutputOptions)
```

{% endtab %}

{% tab title="VB" %}

```vb
Dim htmlOutputOptions As pdftron.PDF.Convert.HTMLOutputOptions = New pdftron.PDF.Convert.HTMLOutputOptions()
' Set e_reflow_full content reflow setting
htmlOutputOptions.SetContentReflowSetting(pdftron.PDF.Convert.HTMLOutputOptions.ContentReflowSetting.e_reflow_full)
' Convert PDF document to HTML with full reflow option turned on
' But requires the Structured Output module
Convert.ToHtml(filename, output_filename, htmlOutputOptions)
```

{% endtab %}
{% endtabs %}

#### Convert with reflow paragraphs (deprecated)

To convert PDF Documents to HTML format with reflow paragraphs.

{% hint style="warning" %}
\*\* 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 ](/core/learn-more/modules.md#pdf2html-reflow-paragraph-module).
{% endhint %}

{% tabs %}
{% tab title="C#" %}

```csharp
Convert.HTMLOutputOptions htmlOutputOptions = new Convert.HTMLOutputOptions();
// Set e_reflow_paragraphs content reflow setting
htmlOutputOptions.SetContentReflowSetting(Convert.HTMLOutputOptions.ContentReflowSetting.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);
```

{% endtab %}

{% tab title="C++" %}

```cpp
Convert::HTMLOutputOptions htmlOutputOptions;
// Set e_reflow_paragraphs content reflow setting
htmlOutputOptions.SetContentReflowSetting(Convert::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);
```

{% endtab %}

{% tab title="Go" %}

```go
htmlOutputOptions := NewHTMLOutputOptions()
// Set e_reflow_paragraphs content reflow setting
htmlOutputOptions.SetContentReflowSetting(HTMLOutputOptionsE_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
ConvertToHtml(filename, output_filename, htmlOutputOptions)
```

{% endtab %}

{% tab title="Java" %}

```java
Convert.HTMLOutputOptions htmlOutputOptions = new Convert.HTMLOutputOptions();
// Set e_reflow_paragraphs content reflow setting
htmlOutputOptions.setContentReflowSetting(Convert.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);
```

{% endtab %}

{% tab title="JavaScript" %}

```js
Convert.HTMLOutputOptions htmlOutputOptions = new Convert.HTMLOutputOptions();
// Set e_reflow_paragraphs content reflow setting
htmlOutputOptions.setContentReflowSetting(Convert.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);
```

{% endtab %}

{% tab title="PHP" %}

```php
$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);
```

{% endtab %}

{% tab title="Python" %}

```python
htmlOutputOptions = 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)
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
$htmlOutputOptions = Convert::HTMLOutputOptions.new()
# Set e_reflow_paragraphs content reflow setting
$htmlOutputOptions.SetContentReflowSetting(Convert::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)
```

{% endtab %}

{% tab title="VB" %}

```vb
Dim htmlOutputOptions As pdftron.PDF.Convert.HTMLOutputOptions = New pdftron.PDF.Convert.HTMLOutputOptions()
' Set e_reflow_paragraphs content reflow setting
htmlOutputOptions.SetContentReflowSetting(pdftron.PDF.Convert.HTMLOutputOptions.ContentReflowSetting.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)
```

{% endtab %}
{% endtabs %}

[Convert PDF to HTML - Sample Code](/core/get-started/samples/pdf2htmltest.md) Full sample code which shows how to convert generic PDF documents to HTML format. Sample code provided in Python, C++, C#, Java, Node.js (JavaScript), PHP, Ruby, Go and VB.

### HTMLOutputOptions

The following table illustrates which options apply to which conversion engines.

| Settings API                    | Fixed Position | Reflow Paragraphs (Deprecated) | Full Reflow |
| ------------------------------- | -------------- | ------------------------------ | ----------- |
| SetContentReflowSetting         | X              | X                              | X           |
| SetDPI                          | X              |                                |             |
| SetExternalLinks                | X              |                                |             |
| SetInternalLinks                | X              |                                |             |
| SetMaximumImagePixels           | X              |                                |             |
| SetReportFile                   | X              |                                |             |
| SetScale                        | X              |                                |             |
| SetSimplifyText                 | X              |                                |             |
| SetJPGQuality                   | X              | X                              |             |
| SetPreferJPG                    | X              | X                              |             |
| SetDisableVerticalSplit         |                | X                              |             |
| SetImageDPI                     |                | X                              |             |
| SetFileConversionTimeoutSeconds |                | X                              |             |
| SetNoPageWidth                  |                | X                              |             |
| SetSimpleLists                  |                | X                              |             |
| SetTitle                        |                | X                              |             |
| SetConnectHyphens               |                | X                              | X           |
| SetEmbedImages                  |                | X                              | X           |
| SetPages                        |                | X                              | X           |
| SetPDFPassword                  |                | X                              | X           |
| SetSearchableImageSetting       |                | X                              | X           |
| SetLanguage                     |                |                                | X           |

### About PDF to HTML


---

# 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/reusable-content/guides/guides-features-conversion-convertpdf2html.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.
