> 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/core/conversion/convert-pdf.md).

# Convert PDF to multiple file types on Server/Desktop

Convert PDF documents to various formats without an internet connection. Convert to DOCX, HTML, SVG, and more with PDF Converter (SVG, XPS, TIFF, JPG, RTF, TXT, More) Full sample code for high-quality

To convert PDF documents to different format types.

{% hint style="info" %}
Internet connection is not required for conversion.
{% endhint %}

{% hint style="info" %}
Convert PDF to DOCX, DOC, HTML, SVG, TIF, PNG, JPEG, XPS, EPUB, TXT, and many other formats.
{% endhint %}

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
PDFDoc doc = new PDFDoc(filename);

// Convert PDF document to SVG
Convert.ToSvg(doc, output_filename + ".svg");

// Convert PDF document to XPS
Convert.ToXps(filename, output_filename + ".xps");

// Convert PDF document to multipage TIFF
Convert.TiffOutputOptions tiff_options = new Convert.TiffOutputOptions();
tiff_options.SetDPI(200);
tiff_options.SetDither(true);
tiff_options.SetMono(true);
Convert.ToTiff(filename, output_filename + ".tiff", tiff_options);

// Convert PDF to XOD
Convert.ToXod(filename, output_filename + ".xod");

// Convert PDF to HTML
Convert.ToHtml(filename, output_filename + ".html");

PDFDraw draw = new PDFDraw();
Page pg = doc.GetPage(1);

// Convert the first PDF page to PNG
draw.Export(pg, output_filename + ".png");

// Convert the first PDF page to JPEG
draw.Export(pg, output_filename + ".jpg", "JPEG");
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
PDFDoc doc(filename);

// Convert PDF document to SVG
Convert::ToSvg(doc, output_filename + ".svg");

// Convert PDF document to XPS
Convert::ToXps(filename, output_filename + ".xps");

// Convert PDF document to multipage TIFF
Convert::TiffOutputOptions tiff_options = new Convert::TiffOutputOptions();
tiff_options.SetDPI(200);
tiff_options.SetDither(true);
tiff_options.SetMono(true);
Convert::ToTiff(filename, output_filename + ".tiff", tiff_options);

// Convert PDF to XOD
Convert::ToXod(filename, output_filename + ".xod");

// Convert PDF to HTML
Convert::ToHtml(filename, output_filename + ".html");

PDFDraw draw;
Page pg = doc.GetPage(1);

// Convert the first PDF page to PNG
draw.Export(pg, output_filename + ".png");

// Convert the first PDF page to JPEG
draw.Export(pg, output_filename + ".jpg", "JPEG");
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
doc := NewPDFDoc(filename)

// Convert PDF document to SVG
ConvertToSvg(doc, output_filename + ".svg")

// Convert PDF document to XPS
ConvertToXps(filename, output_filename + ".xps")

// Convert PDF document to multipage TIFF
tiffOptions := NewTiffOutputOptions()
tiffOptions.SetDPI(200)
tiffOptions.SetDither(true)
tiffOptions.SetMono(true)
ConvertToTiff(filename, output_filename + ".tiff", tiff_options)

// Convert PDF to XOD
ConvertToXod(filename, output_filename + ".xod")

// Convert PDF to HTML
ConvertToHtml(filename, output_filename + ".html")

draw := NewPDFDraw()
pg := doc.GetPage(1)

// Convert the first PDF page to PNG
draw.Export(pg, output_filename + ".png")

// Convert the first PDF page to JPEG
draw.Export(pg, output_filename + ".jpg", "JPEG")
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
PDFDoc doc = new PDFDoc(filename);

// Convert PDF document to SVG
Convert.toSvg(doc, output_filename + ".svg");

// Convert PDF document to XPS
Convert.toXps(filename, output_filename + ".xps");

// Convert PDF document to multipage TIFF
Convert.TiffOutputOptions tiff_options = new Convert.TiffOutputOptions();
tiff_options.SetDPI(200);
tiff_options.SetDither(true);
tiff_options.SetMono(true);
Convert.toTiff(filename, output_filename + ".tiff", tiff_options);

// Convert PDF to XOD
Convert.toXod(filename, output_filename + ".xod");

// Convert PDF to HTML
Convert.toHtml(filename, output_filename + ".html");

PDFDraw draw = new PDFDraw();
Page pg = doc.getPage(1);

// Convert the first PDF page to PNG
draw.export(pg, output_filename + ".png");

// Convert the first PDF page to JPEG
draw.export(pg, output_filename + ".jpg", "JPEG");
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
async function main() {
  const doc = await PDFNet.PDFDoc.createFromFilePath(filename);

  // Convert PDF document to SVG
  await PDFNet.Convert.docToSvg(doc, output_filename + ".svg");

  // Convert PDF document to XPS
  await PDFNet.Convert.fileToXps(filename, output_filename + ".xps");

  // Convert PDF document to multipage TIFF
  const tiff_options = new PDFNet.Convert.TiffOutputOptions();
  tiff_options.setDPI(200);
  tiff_options.setDither(true);
  tiff_options.setMono(true);
  await PDFNet.Convert.fileToTiff(filename, output_filename + ".tiff", tiff_options);

  // Convert PDF to XOD
  await PDFNet.Convert.fileToXod(filename, output_filename + ".xod");

  // Convert PDF to HTML
  await PDFNet.Convert.fileToHtml(filename, output_filename + ".html");

  const draw = await PDFNet.PDFDraw.create();
  const pg = await doc.getPage(1);

  // Convert the first PDF page to PNG
  await draw.export(pg, output_filename + '.png');

  // Convert the first PDF page to JPEG
  await draw.export(pg, output_filename + '.jpg', 'JPEG');
}
PDFNet.runWithCleanup(main);
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
val doc = PDFDoc(filename)

// Convert PDF document to SVG
Convert.toSvg(doc, output_filename + ".svg")

// Convert PDF document to XPS
Convert.toXps(filename, output_filename + ".xps")

// Convert PDF document to multipage TIFF
Convert.TiffOutputOptions tiff_options = new Convert.TiffOutputOptions()
tiff_options.SetDPI(200)
tiff_options.SetDither(true)
tiff_options.SetMono(true)
Convert.toTiff(filename, output_filename + ".tiff", tiff_options)

// Convert PDF to XOD
Convert.toXod(filename, output_filename + ".xod")

// Convert PDF to HTML
Convert.toHtml(filename, output_filename + ".html")

val draw = PDFDraw()
val pg = doc.getPage(1)

// Convert the first PDF page to PNG
draw.export(pg, output_filename + ".png")

// Convert the first PDF page to JPEG
draw.export(pg, output_filename + ".jpg", "JPEG")
```

{% endcode %}
{% endtab %}

{% tab title="Obj-C" %}
{% code lineNumbers="true" %}

```objc
PTPDFDoc* doc = [[PTPDFDoc alloc] initWithFilepath:filename];

// Convert PDF document to SVG
[PTConvert ToSvgWithPDFDoc:doc in_filename:output_filename in_options:nil];

// Convert PDF document to XPS
[PTConvert ToXpsWithFilename:filename in_outputFilename:output_filename options:nil];

// Convert PDF document to multipage TIFF
PTTiffOutputOptions* tiff_options = [[PTTiffOutputOptions alloc] init];
[tiff_options SetDPI:200];
[tiff_options SetDither:true];
[tiff_options SetMono:true];
[PTConvert ToTiff:filename out_path:output_filename options:tiff_options];

// Convert PDF to XOD
[PTConvert ToXodWithFilename:filename out_filename:output_filename options:nil];

// Convert PDF to HTML
[PTConvert ToHtmlWithFilename:filename out_filename:output_filename options:nil];

PTPDFDraw *draw = [[PTPDFDraw alloc] init];
PTPage *pg = [doc GetPage: 1];

// Convert the first PDF page to PNG
[draw  Export:pg filename:output_filename format: @"PNG"];

// Convert the first PDF page to JPEG
[draw  Export:pg filename:output_filename format: @"JPEG"];
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code lineNumbers="true" %}

```swift
let doc: PTPDFDoc = PTPDFDoc(filepath:filename)

// Convert PDF document to SVG
PTConvert.toSvg(with:doc, in_filename:output_filename, in_options:nil);

// Convert PDF document to XPS
PTConvert.toXps(withFilename:filename in_outputFilename:output_filename, options:nil);

// Convert PDF document to multipage TIFF
PTTiffOutputOptions tiff_options = PTTiffOutputOptions()
tiff_options.SetDPI(200);
tiff_options.SetDither(true);
tiff_options.SetMono(true);
Convert.toTiff(filename, out_path:output_filename, options:tiff_options);

// Convert PDF to XOD
Convert.toXod(withFilename:filename, out_filename:output_filename, options:nil);

// Convert PDF to HTML
Convert.toHtml(withFilename:filename, out_filename:output_filename, options:nil);

let draw: PTPDFDraw = PTPDFDraw()
let pg: PTPage = doc.getPage(1)

// Convert the first PDF page to PNG
draw.export(pg, filename:output_filename, format: "PNG")

// Convert the first PDF page to JPEG
draw.export(pg, filename:output_filename, format: "JPEG")
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
$doc = new PDFDoc(filename);

// Convert PDF document to SVG
Convert::ToSvg($doc, $output_filename.".svg");

// Convert PDF document to XPS
Convert::ToXps($filename, $output_filename.".xps");

// Convert PDF document to multipage TIFF
$tiff_options = new Convert::TiffOutputOptions();
$tiff_options.SetDPI(200);
$tiff_options.SetDither(true);
$tiff_options.SetMono(true);
Convert::ToTiff($filename, $output_filename.".tiff", $tiff_options);

// Convert PDF to XOD
Convert::ToXod($filename, $output_filename.".xod");

// Convert PDF to HTML
Convert::ToHtml($filename, $output_filename.".html");

$draw = new PDFDraw();
$pg = $doc->GetPage(1);

// Convert the first PDF page to PNG
draw->Export($pg, $output_filename.".png");

// Convert the first PDF page to JPEG
draw->Export($pg, $output_filename.".jpg", "JPEG");
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
doc = PDFDoc(filename)

# Convert PDF document to SVG
Convert.ToSvg(doc, output_filename + ".svg")

# Convert PDF document to XPS
Convert.ToXps(filename, output_filename + ".xps")

# Convert PDF document to multipage TIFF
tiff_options = Convert.TiffOutputOptions()
tiff_options.SetDPI(200)
tiff_options.SetDither(true)
tiff_options.SetMono(true)
Convert.ToTiff(filename, output_filename + ".tiff", tiff_options)

# Convert PDF to XOD
Convert.ToXod(filename, output_filename + ".xod")

# Convert PDF to HTML
Convert.ToHtml(filename, output_filename + ".html")

draw = PDFDraw()
pg = doc.GetPage(1)

# Convert the first PDF page to PNG
draw.Export(pg, output_filename + ".png")

# Convert the first PDF page to JPEG
draw.Export(pg, output_filename + ".jpg", "JPEG")
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
doc = PDFDoc.new(filename)

# Convert PDF document to SVG
Convert.ToSvg(doc, output_filename + ".svg")

# Convert PDF document to XPS
Convert.ToXps(filename, output_filename + ".xps")

# Convert PDF document to multipage TIFF
tiff_options = Convert::TiffOutputOptions.new()
tiff_options.SetDPI(200)
tiff_options.SetDither(true)
tiff_options.SetMono(true)
Convert.ToTiff(filename, output_filename + ".tiff", tiff_options)

# Convert PDF to XOD
Convert.ToXod(filename, output_filename + ".xod")

# Convert PDF to HTML
Convert.ToHtml(filename, output_filename + ".html")

draw = PDFDraw.new
pg = doc.GetPage(1)

# Convert the first PDF page to PNG
draw.Export(pg, output_filename + ".png")

# Convert the first PDF page to JPEG
draw.Export(pg, output_filename + ".jpg", "JPEG")
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
Dim doc As PDFDoc = New PDFDoc

' Convert PDF document to SVG
Convert.ToSvg(doc, output_filename + ".svg")

' Convert PDF document to XPS
Convert.ToXps(filename, output_filename + ".xps")

' Convert PDF document to multipage TIFF
Dim tiff_options As Convert.TiffOutputOptions = New Convert.TiffOutputOptions()
tiff_options.SetDPI(200)
tiff_options.SetDither(true)
tiff_options.SetMono(true)
Convert.ToTiff(filename, output_filename + ".tiff", tiff_options)

' Convert PDF to XOD
Convert.ToXod(filename, output_filename + ".xod")

' Convert PDF to HTML
Convert.ToHtml(filename, output_filename + ".html")

Using draw As PDFDraw = New PDFDraw
Dim pg As Page = doc.GetPage(1)

' Convert the first PDF page to PNG
draw.Export(pg, output_filename + ".png")

' Convert the first PDF page to JPEG
draw.Export(pg, output_filename + ".jpg", "JPEG")
```

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

[PDF Converter (SVG, XPS, TIFF, JPG, RTF, TXT, More)](/core/get-started/samples/converttest.md) 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 available in Python, C# (.Net), C++, Go, Java, Node.js (JavaScript), PHP, Ruby, VB

## About converting from PDF

The Apryse SDK also supports converting from PDF to other formats like EMF, EPUB, XOD, HTML and XPS.

In addition to the document formats, exporting to image formats like TIFF, SVG, PNG and JPEG are supported too.

Semantic structure information like tables, headers, footers, paragraphs are not part of the PDF specification and do not exist in PDFs. To extract this type of data, any type of conversion or extraction tool will need to have a good document understanding to differentiate between tables or paragraphs. As part of our efforts at Apryse to provide cutting edge document tools, we have created [Apryse Smart Data Extraction](/core/smart-data-extraction/smart-data-extraction.md) - APIs for extracting structured data to JSON


---

# 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/core/conversion/convert-pdf.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.
