GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / TiffAddToMultiPageFile Method / TiffAddToMultiPageFile(Int32,Int32,TiffCompression,Int32) 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.
The compression quality level from 0 to 100. 0 means the worst quality and the best compression, 100 means the best quality and the worst compression. This parameter is ignored when the required compression scheme is different than JPEG.
Example





In This Topic
TiffAddToMultiPageFile(Int32,Int32,TiffCompression,Int32) 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, _
   ByVal JpegQuality As Integer _
) As GdPictureStatus
public GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID,
   TiffCompression Compression,
   int JpegQuality
)
public function TiffAddToMultiPageFile( 
    TiffImageID: Integer;
    ImageID: Integer;
    Compression: TiffCompression;
    JpegQuality: Integer
): GdPictureStatus; 
public function TiffAddToMultiPageFile( 
   TiffImageID : int,
   ImageID : int,
   Compression : TiffCompression,
   JpegQuality : int
) : GdPictureStatus;
public: GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID,
   TiffCompression Compression,
   int JpegQuality
) 
public:
GdPictureStatus TiffAddToMultiPageFile( 
   int TiffImageID,
   int ImageID,
   TiffCompression Compression,
   int JpegQuality
) 

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
JpegQuality
The compression quality level from 0 to 100. 0 means the worst quality and the best compression, 100 means the best quality and the worst compression. This parameter is ignored when the required compression scheme is different than JPEG.

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.

This method requires the Image Documents component to run.

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 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);
}
See Also