Skip to main content
Version: Version 1.7

Convert a PDF document to an image

Convert a PDF document into an output image suitable for a specific purpose, such as archiving, digital viewing, or faxing. The conversion profile can be adjusted to suit the specific requirements of the document workflow.

Quick start

Download the full sample now in C#, Java, C, and Python.

tip

For more information about PDF to image conversion profiles, see Conversion profiles.

Steps to convert a document

  1. Reading the input document
  2. Selecting a conversion profile
  3. Adjusting the conversion profile
  4. Converting the document to an image
  5. Full example

Before you begin

Reading the input document

First you need to read the PDF document you want to convert. To do this, load the input document from the file system into a (read-only) PDF Document. This Document can then later be passed to the Converter.

// Open image document
using var inStr = File.OpenRead(inPath);
using var inDoc = Document.Open(inStr);

Selecting a conversion profile

You start the conversion process by creating a conversion Profile object. The Profile object defines the parameters that are applied to the conversion process.

This example uses the Archive profile, which is intended for document workflows that generate an output for archiving in TIFF image format.

// Create a profile that defines the conversion parameters.
// The Archive profile converts PDF documents to TIFF images for archiving.

var profile = new Profiles.Archive();

Adjusting the conversion profile

The default conversion Profile settings are sufficient for most document workflows. If the document workflow has specific requirements (for example, the use of a specific compression algorithm), you can adjust the properties of the conversion Profile directly.

For more information about PDF to image conversion profiles, see Conversion profiles.

Converting the document to an image

After creating the Profile object and adjusting for any workflow-specific properties, the final step is to instantiate a Converter object and call its ConvertDocument method. The output image file is created at the specified path.

// Create output stream
using var outStr = File.Create(outPath);

// Convert the PDF document to an image document
using var outDoc = new Converter().ConvertDocument(inDoc, outStr, profile);

Full example

// Open input document
using var inStr = File.OpenRead(inPath);
using var inDoc = Document.Open(inStr);

// Create a profile that defines the initial conversion parameters.
// The Archive profile converts PDF documents to TIFF images for archiving.
var profile = new Profiles.Archive();

// Optionally, the profile's parameters can be changed according to the
// requirements of your conversion process.

// Create output stream
using var outStr = File.Create(outPath);

// Convert the PDF document to an image document
using var outDoc = new Converter().ConvertDocument(inDoc, outStr, profile);