GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureDocumentConverter Class / SaveAsTIFF Method / SaveAsTIFF(String,TiffCompression) Method
The file path where the destination image file will save. If the specified file already exists, it will be overwritten.
A member of the TiffCompression enumeration. Specifies the compression method to be used to compress the resulting TIFF image.
Example





In This Topic
SaveAsTIFF(String,TiffCompression) Method
In This Topic
This method converts and saves the currently loaded document to a TIFF image file according to a file path you have specified.

The resulting image will be compressed using the compression method according to your preference.

Syntax
'Declaration
 
Public Overloads Function SaveAsTIFF( _
   ByVal FilePath As String, _
   Optional ByVal TiffCompression As TiffCompression _
) As GdPictureStatus
public function SaveAsTIFF( 
    FilePath: String;
    TiffCompression: TiffCompression
): GdPictureStatus; 
public function SaveAsTIFF( 
   FilePath : String,
   TiffCompression : TiffCompression
) : GdPictureStatus;
public: GdPictureStatus SaveAsTIFF( 
   string* FilePath,
   TiffCompression TiffCompression
) 
public:
GdPictureStatus SaveAsTIFF( 
   String^ FilePath,
   TiffCompression TiffCompression
) 

Parameters

FilePath
The file path where the destination image file will save. If the specified file already exists, it will be overwritten.
TiffCompression
A member of the TiffCompression enumeration. Specifies the compression method to be used to compress the resulting TIFF image.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
Remarks
Keep noted that you have to specify a full file path with the correct file extension, which should be "tif" or "tiff".

The currently selected page remains selected after saving.

This method requires the Image Conversion component to run.

Example
Converting and saving a PDF document to a TIFF image file.
Using gdpictureDocumentConverter As New GdPictureDocumentConverter()
    Dim status As GdPictureStatus = gdpictureDocumentConverter.LoadFromFile("drawing.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF)
    If status = GdPictureStatus.OK Then
        gdpictureDocumentConverter.RasterizationDPI = 300
        status = gdpictureDocumentConverter.SaveAsTIFF("drawing_image.tiff", TiffCompression.TiffCompressionAUTO)
        If status = GdPictureStatus.OK Then
            MessageBox.Show("The file has been saved successfully.", "GdPicture")
        Else
            MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "GdPicture")
        End If
    Else
        MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "GdPicture")
    End If
End Using
using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
{
    GdPictureStatus status = gdpictureDocumentConverter.LoadFromFile("drawing.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF);
    if (status == GdPictureStatus.OK)
    {
        gdpictureDocumentConverter.RasterizationDPI = 300;
        status = gdpictureDocumentConverter.SaveAsTIFF("drawing_image.tiff", TiffCompression.TiffCompressionAUTO);
        if (status == GdPictureStatus.OK)
        {
            MessageBox.Show("The file has been saved successfully.", "GdPicture");
        }
        else
        {
            MessageBox.Show("The file has failed to save. Status: " + status.ToString(), "GdPicture");
        }
    }
    else
    {
        MessageBox.Show("The file has failed to load. Status: " + status.ToString(), "GdPicture");
    }
}
See Also