# Converting PDF to TIFF with RadPdfProcessing in .NET Standard

## Environment

| Version    | Product          | Author                                                                          |
| ---------- | ---------------- | ------------------------------------------------------------------------------- |
| 2025.1.205 | RadPdfProcessing | [Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova) |

## Description

Learn how to convert PDF documents to TIFF format in .NET Standard.

## Solution

To convert PDF documents to TIFF images in .NET Standard, follow these steps:

1. Use the [SkiaImageFormatProvider](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/formats-and-conversion/convert-to-image/using-image-format-provider) to export the PDF pages to images.
2. Use the [System.Drawing.Common](https://www.nuget.org/packages/System.Drawing.Common/) library to assemble these images into a multi-page TIFF file.

The following example demonstrates the process:

```csharp
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using Telerik.Documents.Fixed.FormatProviders.Image.Skia;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
using Telerik.Windows.Documents.Fixed.Model;
using System.IO;

namespace PdfToTIFFNetCore
{
    internal class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
            RadFixedDocument fixedDocument = pdfFormatProvider.Import(File.ReadAllBytes("your-pdf-file.pdf"), TimeSpan.FromSeconds(10));
            SkiaImageFormatProvider imageProvider = new SkiaImageFormatProvider();
            string exportedFileName = "Exported.tiff";
            using (FileStream fileStream = new FileStream(exportedFileName, FileMode.Create))
            {
                System.Drawing.Imaging.Encoder encoder = System.Drawing.Imaging.Encoder.SaveFlag;
                ImageCodecInfo codecInfo = GetEncoderInfo("image/tiff");
                EncoderParameters encoderParams = new EncoderParameters(1);
                encoderParams.Param[0] = new EncoderParameter(encoder, (long)EncoderValue.MultiFrame);

                Bitmap firstImage = null;
                bool firstFrame = true;

                foreach (RadFixedPage page in fixedDocument.Pages)
                {
                    byte[] resultImage = imageProvider.Export(page, TimeSpan.FromSeconds(10));
                    using (MemoryStream ms = new MemoryStream(resultImage))
                    {
                        using (Bitmap bitmap = new Bitmap(ms))
                        {
                            if (firstFrame)
                            {
                                firstImage = new Bitmap(bitmap);
                                firstImage.Save(fileStream, codecInfo, encoderParams);
                                firstFrame = false;
                            }
                            else
                            {
                                encoderParams.Param[0] = new EncoderParameter(encoder, (long)EncoderValue.FrameDimensionPage);
                                firstImage.SaveAdd(bitmap, encoderParams);
                            }
                        }
                    }
                }

                encoderParams.Param[0] = new EncoderParameter(encoder, (long)EncoderValue.Flush);
                firstImage.SaveAdd(encoderParams);
            }

            Process.Start(new ProcessStartInfo() { FileName = exportedFileName, UseShellExecute = true });
        }

        private static ImageCodecInfo GetEncoderInfo(string mimeType)
        {
            ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
            foreach (ImageCodecInfo codec in codecs)
            {
                if (codec.MimeType == mimeType)
                {
                    return codec;
                }
            }
            return null;
        }
    }
}
```

Replace `"your-pdf-file.pdf"` with the path to your PDF file. This code creates a TIFF file named `Exported.tiff` that contains all the pages from the PDF document.

## See Also

* [Converting a PDF Document to a Multipage TIFF Image](https://www.telerik.com/document-processing-libraries/documentation/knowledge-base/convert-pdf-to-multipage-tiff-radpdfprocessing)
