GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / TiffSelectPage Method
A unique image identifier of the GdPicture image representing the multipage TIFF image.
The page number of a page you want to select. It must be a value from 1 to TiffGetPageCount.
Example





In This Topic
TiffSelectPage Method (GdPictureImaging)
In This Topic
Selects a required page in the specified multipage TIFF image represented by its unique image identifier. The defined page is selected for further use, which means, that the page can be edited or saved to a different file.

This method only handles multipage TIFF images, both editable or opened as read-only.

Syntax
'Declaration
 
Public Function TiffSelectPage( _
   ByVal ImageID As Integer, _
   ByVal Page As Integer _
) As GdPictureStatus
public GdPictureStatus TiffSelectPage( 
   int ImageID,
   int Page
)
public function TiffSelectPage( 
    ImageID: Integer;
    Page: Integer
): GdPictureStatus; 
public function TiffSelectPage( 
   ImageID : int,
   Page : int
) : GdPictureStatus;
public: GdPictureStatus TiffSelectPage( 
   int ImageID,
   int Page
) 
public:
GdPictureStatus TiffSelectPage( 
   int ImageID,
   int Page
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the multipage TIFF image.
Page
The page number of a page you want to select. It must be a value from 1 to TiffGetPageCount.

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 supports multipage TIFF images, both editable or opened as read-only. If the specified image is not a multipage image, this method will fail.

Just to inform you, that you can check out the currently selected page using the TiffGetCurrentPage method.

This method requires the Image Documents component to run.

Example
Removing the blank pages from a 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);
    int pageNo = 1;
    while (pageNo <= pageCount)
    {
        gdpictureImaging.TiffSelectPage(imageID, pageNo);
        if (gdpictureImaging.IsBlank(imageID))
        {
            gdpictureImaging.TiffDeletePage(imageID, pageNo);
            pageCount--;
        }
        else
        {
            pageNo++;
        }
    }
    gdpictureImaging.TiffSaveMultiPageToFile(imageID, "multipage.tif", TiffCompression.TiffCompressionAUTO);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also