PdfDocumentProcessor.CreateTiff(Stream, Int32, IEnumerable<Int32>) Method
Exports a PDF document to a TIFF image using a stream, the image’s largest edge length, and page numbers.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Docs.v20.2.dll
NuGet Package: DevExpress.Document.Processor
Declaration
Parameters
Name | Type | Description |
---|---|---|
stream | Stream | A Stream object that is a stream to which the TIFF image should be written. |
largestEdgeLength | Int32 | An integer value, specifying the length of the image’s largest dimension, in pixels. |
pageNumbers | IEnumerable<Int32> | A list of page numbers which implement the IEnumerable<T><Int32,> interface. |
Remarks
The largestEdgeLength parameter determines the output image height for pages with portrait orientation and width - for landscape pages.
Note
The CreateTiff method works on Azure Windows Virtual Machines and does not work on Azure Web Apps.
The following example shows how to convert pages to a multi-page Tiff image.
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);
}
}
}
}
Important
The CreateTiff method uses GDI/GDI+ rendering and works only on Windows OS. The PlatformNotSupportedException is thrown on other operating systems.