GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / TiffCreateMultiPageFromFile Method / TiffCreateMultiPageFromFile(String,Boolean) Method
The file path of the source file. Use the empty string to allow the control to prompt users to select a file. Specifies if the file content will be loaded into memory (true). Loading the file content directly into memory results in a better manipulation performance, but it consumes more memory. If you load a file into memory, you can subsequently overwrite or delete the file. Suggested value is false, which means that the file is opened in read access mode.

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

Specifies if the file content will be loaded into memory (true). Loading the file content directly into memory results in a better manipulation performance, but it consumes more memory. If you load a file into memory, you can subsequently overwrite or delete the file. Suggested value is false, which means that the file is opened in read access mode.
Example





In This Topic
TiffCreateMultiPageFromFile(String,Boolean) 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, _
   ByVal LoadInMemory As Boolean _
) As Integer
public int TiffCreateMultiPageFromFile( 
   string FilePath,
   bool LoadInMemory
)
public function TiffCreateMultiPageFromFile( 
    FilePath: String;
    LoadInMemory: Boolean
): Integer; 
public function TiffCreateMultiPageFromFile( 
   FilePath : String,
   LoadInMemory : boolean
) : int;
public: int TiffCreateMultiPageFromFile( 
   string* FilePath,
   bool LoadInMemory
) 
public:
int TiffCreateMultiPageFromFile( 
   String^ FilePath,
   bool LoadInMemory
) 

Parameters

FilePath
The file path of the source file. Use the empty string to allow the control to prompt users to select a file. Specifies if the file content will be loaded into memory (true). Loading the file content directly into memory results in a better manipulation performance, but it consumes more memory. If you load a file into memory, you can subsequently overwrite or delete the file. Suggested value is false, which means that the file is opened in read access mode.

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

LoadInMemory
Specifies if the file content will be loaded into memory (true). Loading the file content directly into memory results in a better manipulation performance, but it consumes more memory. If you load a file into memory, you can subsequently overwrite or delete the file. Suggested value is false, which means that the file is opened in read access mode.

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.

This method requires the Image Documents component to run.

Example
Handling with a multipage tiff document.
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.TiffCompressionAUTO);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
Deleting the last page of 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);
    int pageCount = gdpictureImaging.TiffGetPageCount(imageID);
    gdpictureImaging.TiffDeletePage(imageID, pageCount);
    gdpictureImaging.TiffSaveMultiPageToFile(imageID, "multipage.tif", TiffCompression.TiffCompressionAUTO);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also