Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / TiffSaveMultiPageToFile Method / TiffSaveMultiPageToFile(Int32,String,TiffCompression,Int32) Method
A unique image identifier of the GdPicture image representing the editable multipage TIFF image to be saved.
The file path where the specified image will be saved. Be aware, that if the destination file path is the same as the source file path, the method will fail unless the image has not been loaded in memory.
A member of the TiffCompression enumeration. The resulting TIFF compression scheme to be used.
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
    TiffSaveMultiPageToFile(Int32,String,TiffCompression,Int32) Method
    In This Topic
    Saves a GdPicture image representing the editable multipage TIFF image to a multipage TIFF file acording to what you have specified. You can also define a JPEG quality parameter when the JPEG compression is required using this method.

    Please note that this method only handles editable multipage TIFF images; otherwise it will fail.

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

    Parameters

    ImageID
    A unique image identifier of the GdPicture image representing the editable multipage TIFF image to be saved.
    FilePath
    The file path where the specified image will be saved. Be aware, that if the destination file path is the same as the source file path, the method will fail unless the image has not been loaded in memory.
    Compression
    A member of the TiffCompression enumeration. The resulting TIFF compression scheme to be used.
    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
    Be aware that this method only handles editable multipage TIFF images. You can use the TiffIsEditableMultiPage method to check if a required image is an editable multipage TIFF image.

    Likewise, if the destination file is the same as the source file, the method will fail, unless the image has not been loaded in memory applying the LoadInMemory parameter in the overloaded TiffCreateMultiPageFromFile(String,Boolean) method.

    Just to inform you, that if you are applying CCITT3 or CCITT4 compression scheme, the image you want to save can only have 1bpp pages included, otherwise the LZW compression scheme is used.

    Example
    Saving pages to a multipage tiff.
    Swapping two pages in a multipage tiff document.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        // LoadInMemory parameter is set to true in order to be able to update the input file.
        int imageID = gdpictureImaging.TiffCreateMultiPageFromFile("multipage.tif", true);
        gdpictureImaging.TiffSwapPages(imageID, 1, 2);
        gdpictureImaging.TiffSaveMultiPageToFile(imageID, "multipage.tif", TiffCompression.TiffCompressionJPEG, 90);
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    Saving the pages of a dicom document to a multipage tiff.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        int dcmImageID = gdpictureImaging.CreateGdPictureImageFromFile("image.dcm", false);
     
        // Create a tiff with the first page.
        int tiffImageID = gdpictureImaging.TiffCreateMultiPageFromGdPictureImage(dcmImageID);
     
        // Add the remaining pages as additional pages to the tif.
        int pageCount = gdpictureImaging.DicomGetPageCount(dcmImageID);
        for (int pageNo = 2; pageNo <= pageCount; pageNo++)
        {
            gdpictureImaging.DicomSelectPage(dcmImageID, pageNo);
            gdpictureImaging.TiffAppendPageFromGdPictureImage(tiffImageID, dcmImageID);
        }
     
        gdpictureImaging.TiffSaveMultiPageToFile(tiffImageID, "image.tif", TiffCompression.TiffCompressionJPEG, 90);
        gdpictureImaging.TiffCloseMultiPageFile(tiffImageID);
     
        gdpictureImaging.ReleaseGdPictureImage(tiffImageID);
        gdpictureImaging.ReleaseGdPictureImage(dcmImageID);
    }
    See Also