GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / TiffAddToMultiPageFile Method / TiffAddToMultiPageFile(Int32,Int32,TiffCompression) Method
A unique image identifier of the GdPicture image representing the resulting multipage TIFF image file, that has been previously initialized using one of the TiffSaveAsMultiPageFile() methods. It is the first image resource of the resulting multipage TIFF image file.

Please follow the attached example on how to properly use the method.

A unique image identifier of the GdPicture image representing the image, which will be added to the resulting multipage TIFF image file. You can release this image resource using the ReleaseGdPictureImage method after adding it to the resulting file.
Example





In This Topic
TiffAddToMultiPageFile(Int32,Int32,TiffCompression) Method
In This Topic
Adds a required GdPicture image, which represents a single image, to a specified GdPicture image, which represents the multipage TIFF image file previously initialized by one of the TiffSaveAsMultiPageFile() methods. Both GdPicture images are defined by their unique image identifiers.

This method implements a sequential multipage TIFF writing approach, which is the faster way to create multipage TIFF image files by adding individual pages.

Syntax
'Declaration
 
Public Overloads Function TiffAddToMultiPageFile( _
   ByVal TiffImageID As Integer, _
   ByVal ImageID As Integer, _
   ByVal Compression As TiffCompression _
) As GdPictureStatus
public GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID,
   TiffCompression Compression
)
public function TiffAddToMultiPageFile( 
    TiffImageID: Integer;
    ImageID: Integer;
    Compression: TiffCompression
): GdPictureStatus; 
public function TiffAddToMultiPageFile( 
   TiffImageID : int,
   ImageID : int,
   Compression : TiffCompression
) : GdPictureStatus;
public: GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID,
   TiffCompression Compression
) 
public:
GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID,
   TiffCompression Compression
) 

Parameters

TiffImageID
A unique image identifier of the GdPicture image representing the resulting multipage TIFF image file, that has been previously initialized using one of the TiffSaveAsMultiPageFile() methods. It is the first image resource of the resulting multipage TIFF image file.

Please follow the attached example on how to properly use the method.

ImageID
A unique image identifier of the GdPicture image representing the image, which will be added to the resulting multipage TIFF image file. You can release this image resource using the ReleaseGdPictureImage method after adding it to the resulting file.
Compression

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Please note that you need to close the resulting file using the TiffCloseMultiPageFile method when you finish adding pages.
Example
Generating a multipage tiff, from different image files, using specific compression mode per page.
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 png file*/
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.png");
    // Enabling horizontal differencing predictor mode for lzw compression.
    gdpictureImaging.TagSetValueString(imageID, Tags.TagPredictor, TagType.TagTypeShort, "2");
    gdpictureImaging.TiffAddToMultiPageFile(tiffImageID, imageID, TiffCompression.TiffCompressionLZW);
    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);
}
See Also