The file path including the full document name, where the resulting TIFF file will be saved.

For multi-page TIFF files, please use the ForceTemporaryMode property before loading if you want to overwrite the initial file.

A member of the TiffCompression enumeration. Specifies the compression method to be used to compress the resulting TIFF file.
Example





In This Topic
GdPicture14 Namespace / GdViewer Class / SaveDocumentToTIFF Method / SaveDocumentToTIFF(String,TiffCompression) Method

SaveDocumentToTIFF(String,TiffCompression) Method

In This Topic
Saves the document displayed in the GdViewer control to a file in TIFF format according to a file path you have specified. The file is saved with full GdPicture/XMP annotation support.

Please consider using the BurnAnnotationsToPage(Boolean) method before saving, if you expect, that your annotations will be included in the document content.

The SavingProgress event is raised after each successfully saved page.

Syntax
'Declaration

 

Public Overloads Function SaveDocumentToTIFF( _

   ByVal FilePath As String, _

   ByVal Compression As TiffCompression _

) As GdPictureStatus
public GdPictureStatus SaveDocumentToTIFF( 

   string FilePath,

   TiffCompression Compression

)
public function SaveDocumentToTIFF( 

    FilePath: String;

    Compression: TiffCompression

): GdPictureStatus; 
public function SaveDocumentToTIFF( 

   FilePath : String,

   Compression : TiffCompression

) : GdPictureStatus;
public: GdPictureStatus SaveDocumentToTIFF( 

   string* FilePath,

   TiffCompression Compression

) 
public:

GdPictureStatus SaveDocumentToTIFF( 

   String^ FilePath,

   TiffCompression Compression

) 

Parameters

FilePath
The file path including the full document name, where the resulting TIFF file will be saved.

For multi-page TIFF files, please use the ForceTemporaryMode property before loading if you want to overwrite the initial file.

Compression
A member of the TiffCompression enumeration. Specifies the compression method to be used to compress the resulting TIFF file.

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 if you want to permanently incorporate the annotations to be part of the document content, you need to use the BurnAnnotationsToPage(Boolean) method before saving the file.

The SavingProgress event is raised when processing documents using this method.

Be aware that if the resulting file path is the same as the initial file path for multi-page TIFF files, then the GdPictureStatus.AccessDenied is returned. Please set the ForceTemporaryMode property to true before loading if you want to overwrite the initial file.

Example
How to save your TIFF image displayed in the viewer.
'We assume that the GdViewer1 control has been properly integrated.

GdViewer1.ForceTemporaryMode = True

If GdViewer1.DisplayFromFile("myimage.tif") = GdPictureStatus.OK Then

    'Annotate your document.

    If GdViewer1.BurnAnnotationsToPage(True) = GdPictureStatus.OK Then

        'The same file path is used.

        If GdViewer1.SaveDocumentToTIFF("myimage.tif", TiffCompression.TiffCompressionAUTO) = GdPictureStatus.OK Then

            MessageBox.Show("Done!", "GdViewer.SaveDocumentToTIFF")

        Else

            MessageBox.Show("The file can't be saved. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveDocumentToTIFF")

        End If

    Else

        MessageBox.Show("Annotations can't be burned. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveDocumentToTIFF")

    End If

Else

    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveDocumentToTIFF")
//We assume that the GdViewer1 control has been properly integrated.

GdViewer1.ForceTemporaryMode = true;

if (GdViewer1.DisplayFromFile("myimage.tif") == GdPictureStatus.OK)

{

    //Annotate your document.

    if (GdViewer1.BurnAnnotationsToPage(true) == GdPictureStatus.OK)

    {

        //The same file path is used.

        if (GdViewer1.SaveDocumentToTIFF("myimage.tif", TiffCompression.TiffCompressionAUTO) == GdPictureStatus.OK)

            MessageBox.Show("Done!", "GdViewer.SaveDocumentToTIFF");

        else

            MessageBox.Show("The file can't be saved. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveDocumentToTIFF");

    }

    else

        MessageBox.Show("Annotations can't be burned. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveDocumentToTIFF");

}

else

    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveDocumentToTIFF");
See Also