---
title: "Generate TIFF files using a compression mode per page in C#"
canonical_url: "https://www.nutrient.io/guides/dotnet/samples/create-multipage-tiff-cs/"
md_url: "https://www.nutrient.io/guides/dotnet/samples/create-multipage-tiff-cs.md"
last_updated: "2026-05-14T21:57:26.872Z"
description: "Learn to create multipage TIFF files using C#. This guide covers generating TIFFs with specific compression modes for each page efficiently."
---

# Generate a multipage TIFF file using a compression mode per page in C#

This example shows how to generate a multipage TIFF file using a specific compression mode per page.

[Get Started](https://www.nutrient.io/sdk/dotnet/getting-started.md)

[All Samples](https://www.nutrient.io/guides/dotnet/samples.md)

[Download](https://www.nutrient.io/guides/dotnet/downloads.md)

[Launch Demo](https://www.nutrient.io/demo/)

---

```cs

using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
   /*Adding first page from a jpeg file*/
   int tiffImageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg");

   // After calling TiffSaveAsMultiPageFile, tiffID will specify the multipage tiff identifier.
   gdpictureImaging.TiffSaveAsMultiPageFile(tiffImageID, "multipage.tif", TiffCompression.TiffCompressionJPEG, 75 /*Jpeg quality*/);

   /*Adding second page from a jpg file*/
   int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image2.jpg");
   gdpictureImaging.TiffAddToMultiPageFile(tiffImageID, imageID, TiffCompression.TiffCompressionJPEG, 75);
   gdpictureImaging.ReleaseGdPictureImage(imageID);

   /*Adding third page from a single page tiff-ccitt4 file*/
   imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.tif");
   gdpictureImaging.TiffAddToMultiPageFile(tiffImageID, imageID, TiffCompression.TiffCompressionCCITT4);
   gdpictureImaging.ReleaseGdPictureImage(imageID);

   /*Closing the produced multipage file*/
   gdpictureImaging.TiffCloseMultiPageFile(tiffImageID);
}

```

This code sample is an example that illustrates how to use our SDK. Please adapt it to your specific use case.

---

## Related pages

- [Automatically rotate pages of a multipage TIFF file using OCR and VB.NET](/guides/dotnet/samples/auto-rotate-tiff-vbnet.md)
- [Automatically rotate pages of a multipage TIFF file using OCR and C#](/guides/dotnet/samples/auto-rotate-tiff-cs.md)
- [Convert PDFs, MS Office, and images to TIFF in C#](/guides/dotnet/samples/convert-to-tiff-cs.md)
- [Saving images into folders based on their barcode](/guides/dotnet/samples/barcode-auto-sorting-cs.md)
- [Saving images into folders based on their barcode](/guides/dotnet/samples/barcode-auto-sorting-vbnet.md)
- [Converting a Microsoft Word binary file document (DOC) to a Microsoft Word OpenXML document (DOCX) in C#](/guides/dotnet/samples/doc-to-docx-cs.md)
- [Merging two PDF documents by alternating pages from both files in VB.NET](/guides/dotnet/samples/merge-pdf-alternate-pages-vbnet.md)
- [Using an external OCR engine during PDF/OCR generation](/guides/dotnet/samples/integrate-omnipage-ocr-cs.md)
- [Converting a multipage PDF to a multipage TIFF using color detection in C#](/guides/dotnet/samples/pdf-to-tiff-color-detection-cs.md)
- [Merging two PDF documents by alternating pages from both files in C#](/guides/dotnet/samples/merge-pdf-alternate-pages-cs.md)
- [Converting a multipage PDF to a multipage TIFF using color detection in VB.NET](/guides/dotnet/samples/pdf-to-tiff-color-detection-vbnet.md)
- [Recompress existing PDFs using MRC compression in C#](/guides/dotnet/samples/recompress-pdf-mrc-cs.md)
- [Recompress an existing PDF using color detection in VB.NET](/guides/dotnet/samples/recompress-pdf-vbnet.md)
- [Recompress an existing PDF using color detection in C#](/guides/dotnet/samples/recompress-pdf-cs.md)
- [Recompress existing PDFs using MRC compression in VB.NET](/guides/dotnet/samples/recompress-pdf-mrc-vbnet.md)
- [Highlight and crop an image in C#](/guides/dotnet/samples/select-image-crop-area-cs.md)
- [Highlight and crop an image in VB.NET](/guides/dotnet/samples/select-image-crop-area-vbnet.md)
- [Highlight a region in PDF or an image in VB.NET](/guides/dotnet/samples/select-pdf-image-region-vbnet.md)
- [Choosing the appropriate OCR zone in C#](/guides/dotnet/samples/select-ocr-zone-cs.md)
- [Highlight a region in a PDF or an image in C#](/guides/dotnet/samples/select-pdf-image-region-cs.md)
- [Choosing the appropriate OCR zone in VB.NET](/guides/dotnet/samples/select-ocr-zone-vbnet.md)
- [Save bitonal TIFFs with VB.NET using photometric 0](/guides/dotnet/samples/tiff-photometric-vbnet.md)
- [Convert a multipage TIFF to a multipage JBIG2 in VB.NET](/guides/dotnet/samples/tiff-to-jbig2-vbnet.md)
- [Save bitonal TIFF images with C# and CCITT4](/guides/dotnet/samples/tiff-photometric-cs.md)
- [Convert a multipage TIFF to a multipage JBIG2 in C#](/guides/dotnet/samples/tiff-to-jbig2-cs.md)

