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





In This Topic
TiffSwapPages Method (GdPictureImaging)
In This Topic
Swaps two pages specified by their page numbers in an editable multipage TIFF image, that is represented by its unique image identifier.

This method only handles editable multipage TIFF images; otherwise it will fail.

Syntax
'Declaration
 
Public Function TiffSwapPages( _
   ByVal ImageID As Integer, _
   ByVal Page1 As Integer, _
   ByVal Page2 As Integer _
) As GdPictureStatus
public GdPictureStatus TiffSwapPages( 
   int ImageID,
   int Page1,
   int Page2
)
public function TiffSwapPages( 
    ImageID: Integer;
    Page1: Integer;
    Page2: Integer
): GdPictureStatus; 
public function TiffSwapPages( 
   ImageID : int,
   Page1 : int,
   Page2 : int
) : GdPictureStatus;
public: GdPictureStatus TiffSwapPages( 
   int ImageID,
   int Page1,
   int Page2
) 
public:
GdPictureStatus TiffSwapPages( 
   int ImageID,
   int Page1,
   int Page2
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the editable multipage TIFF image.
Page1
The page number of the one page you want to swap. It must be a value from 1 to GdPictureImaging.TiffGetPageCount.
Page2
The page number of the other page you want to swap. It must be a value from 1 to GdPictureImaging.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 handles an editable multipage TIFF images. You can use the GdPictureImaging.TiffIsEditableMultiPage method to check if a required image is an editable multipage TIFF image.

Likewise, for saving the provided modifications you need to use the GdPictureImaging.TiffSaveMultiPageToFile method.

This method requires the Image Documents component to run.

Example
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);
}
See Also