Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / TiffCreateMultiPageFromFile Method / TiffCreateMultiPageFromFile(String) Method
The file path of the source file. Use the empty string to allow the control to prompt users to select a file.

You can subsequently use the GetLastPath method to retrieve the path of the selected file.

Example





In This Topic
    TiffCreateMultiPageFromFile(String) Method
    In This Topic
    Creates a new GdPicture image representing the editable multipage TIFF image based on an input file. The newly created image is identified by its unique non-zero image identifier.

    Please note that you can specify the read-only or read-write mode using the TiffOpenMultiPageForWrite method before loading the file.

    Syntax
    'Declaration
     
    
    Public Overloads Function TiffCreateMultiPageFromFile( _
       ByVal FilePath As String _
    ) As Integer
    public int TiffCreateMultiPageFromFile( 
       string FilePath
    )
    public function TiffCreateMultiPageFromFile( 
        FilePath: String
    ): Integer; 
    public function TiffCreateMultiPageFromFile( 
       FilePath : String
    ) : int;
    public: int TiffCreateMultiPageFromFile( 
       string* FilePath
    ) 
    public:
    int TiffCreateMultiPageFromFile( 
       String^ FilePath
    ) 

    Parameters

    FilePath
    The file path of the source file. Use the empty string to allow the control to prompt users to select a file.

    You can subsequently use the GetLastPath method to retrieve the path of the selected file.

    Return Value

    A unique image identifier of the GdPicture image representing the newly created editable multipage TIFF image. The returned value is non-zero if the image is successfully created. Please first of all use the GetStat method to determine if this method has been successful.

    Be aware that you need to release the image with the ReleaseGdPictureImage method after being used.

    Remarks
    All document formats currently supported by the toolkit are listed here.
    Example
    Handling with a multipage tiff document.
    Swapping two pages in a multipage tiff document.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        int imageID = gdpictureImaging.TiffCreateMultiPageFromFile("multipage1.tif");
        gdpictureImaging.TiffSwapPages(imageID, 1, 2);
        gdpictureImaging.TiffSaveMultiPageToFile(imageID, "multipage2.tif", TiffCompression.TiffCompressionAUTO);
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    Deleting the last page of a multipage tiff document.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        int imageID = gdpictureImaging.TiffCreateMultiPageFromFile("multipage1.tif");
        int pageCount = gdpictureImaging.TiffGetPageCount(imageID);
        gdpictureImaging.TiffDeletePage(imageID, pageCount);
        gdpictureImaging.TiffSaveMultiPageToFile(imageID, "multipage2.tif", TiffCompression.TiffCompressionAUTO);
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    See Also