GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / AppendToTiff Method / AppendToTiff(Int32,String,TiffCompression,Int32) Method
A unique image identifier of the GdPicture image representing the single image, that you want to append as a new page at the end of the destination TIFF file.
The file path of the destination TIFF file, where the specified image will be appended. If this file does not exist, it will be created.
A member of the TiffCompression enumeration. The resulting TIFF compression scheme to be used.
Specifies the JPEG compression quality, between 1 (worst quality) and 100 (better quality). This parameter is ignored when the specified TIFF compression scheme is different than JPEG.
Example





In This Topic
AppendToTiff(Int32,String,TiffCompression,Int32) Method
In This Topic
Appends an image resource, represented by its unique GdPicture image identifier, to a new or existing single or multipage TIFF file according to what you have specified. This method allows you to set a JpegQuality parameter if you will apply a JPEG compression scheme.

The image is added as a new page after the last page of the specified destination TIFF file. If you want to add more pages from your source file to the destination TIFF file, please use this method for each single page.

Syntax
'Declaration
 
Public Overloads Function AppendToTiff( _
   ByVal ImageID As Integer, _
   ByVal FilePath As String, _
   ByVal Compression As TiffCompression, _
   ByVal JpegQuality As Integer _
) As GdPictureStatus
public GdPictureStatus AppendToTiff( 
   int ImageID,
   string FilePath,
   TiffCompression Compression,
   int JpegQuality
)
public function AppendToTiff( 
    ImageID: Integer;
    FilePath: String;
    Compression: TiffCompression;
    JpegQuality: Integer
): GdPictureStatus; 
public function AppendToTiff( 
   ImageID : int,
   FilePath : String,
   Compression : TiffCompression,
   JpegQuality : int
) : GdPictureStatus;
public: GdPictureStatus AppendToTiff( 
   int ImageID,
   string* FilePath,
   TiffCompression Compression,
   int JpegQuality
) 
public:
GdPictureStatus AppendToTiff( 
   int ImageID,
   String^ FilePath,
   TiffCompression Compression,
   int JpegQuality
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the single image, that you want to append as a new page at the end of the destination TIFF file.
FilePath
The file path of the destination TIFF file, where the specified image will be appended. If this file does not exist, it will be created.
Compression
A member of the TiffCompression enumeration. The resulting TIFF compression scheme to be used.
JpegQuality
Specifies the JPEG compression quality, between 1 (worst quality) and 100 (better quality). This parameter is ignored when the specified TIFF 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
Just to remind you, that the toolkit creates the destination file according to the file path you have specified if this file does not exist yet.

Be aware that if you are applying CCITT3 or CCITT4 compression scheme, the image you want to append can only be 1bpp, otherwise the LZW compression scheme is used.

Example
Appending a jpeg image at the last page of an existing multipage tiff image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg");
    gdpictureImaging.AppendToTiff(imageID, "multipage.tif", TiffCompression.TiffCompressionJPEG, 75);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also