In This Topic
Programming / TIFF / Generating a multipage TIFF file using specific compression mode per page

Generating a multipage TIFF file using specific compression mode per page

In This Topic
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);
}