GdPicture.NET Reference Guide
TiffSwapPages Method (GdPictureImaging)
Example 





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 TiffGetPageCount.
The page number of the other page you want to swap. It must be a value from 1 to TiffGetPageCount.
Swaps two pages specified by their page numbers in an editable multipage TIFF image, that is represented by its unique image identifier.

Please note that 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 TiffGetPageCount.
Page2
The page number of the other page you want to swap. 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 handles an editable multipage TIFF images. You can use the 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 TiffSaveMultiPageToFile(Int32,String,TiffCompression) method.

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

Reference

GdPictureImaging Class
GdPictureImaging Members
TiffCreateMultiPageFromFile(String) Method
TiffSaveMultiPageToFile(Int32,String,TiffCompression) Method
TiffIsEditableMultiPage Method
TiffGetPageCount Method