Skip to main content
A newer version of this page is available. .

How to: Export a PDF Document to a Multi-Page Tiff

  • 2 minutes to read

Important

You need a license to the DevExpress Office File API or DevExpress Universal Subscription to use these examples in production code. Refer to the DevExpress Subscription page for pricing information.

The following example shows how to export pages to a multi-page Tiff image.

Important

The CreateTiff method uses GDI/GDI+ rendering and works only on Windows OS. The PlatformNotSupportedException is thrown on other operating systems.

Follow the steps below to perform the export:

  • Create a PdfDocumentProcessor instance and load the required PDF document using the overloaded PdfDocumentProcessor.LoadDocument method.
  • Call one of the PdfDocumentProcessor.CreateTiff overloaded methods using, for example, the file path where the generated image should be located, the largestEdgeLength parameter measured in pixels and page numbers. The largestEdgeLength parameter determines the images’ height for pages in the portrait orientation and width for landscape pages.
using DevExpress.Pdf;

namespace ExportToTiff
{
    class Program
    {
        static void Main(string[] args)
        {

            int largestEdgeLength = 1000;
            int[] pageNumbers = new int[] { 1, 3, 5 };

            // Create a PDF Document Processor.
            using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
            {

                // Load a document. 
                processor.LoadDocument("..\\..\\Document.pdf");

                // Export pages to a multi-page tiff image.
                processor.CreateTiff("..\\..\\Image.tiff", largestEdgeLength, pageNumbers);
            }
        }
    }
}