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 As Integer, _
ByVal As Integer, _
ByVal As Integer _
) As GdPictureStatus
public GdPictureStatus TiffSwapPages(
int ,
int ,
int
)
public function TiffSwapPages(
: Integer;
: Integer;
: Integer
): GdPictureStatus;
public function TiffSwapPages(
: int,
: int,
: int
) : GdPictureStatus;
public: GdPictureStatus TiffSwapPages(
int ,
int ,
int
)
public:
GdPictureStatus TiffSwapPages(
int ,
int ,
int
)
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.
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);
}
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