Hello,
I am sorry for the misunderstanding. To replace the position of two pages in the same multi-page TIFF file, you can use something as the following code:
+--------------------+
private void button4_Click(object sender, System.EventArgs e)
{
// Get the Multi-page TIFF file information
CodecsImageInfo ImgInfo = CodecsCommand.GetInformation(TxtImageName.Text,true);
// Load the Multi-page TIFF file
LeadImage = CodecsCommand.Load(@"c:\multipage.tif");
// Load the 3rd page (from the Multi-page TIFF file) on the temporary raster image TempImg1
IRasterImage TempImg1 = CodecsCommand.Load(@"c:\multipage.tif" ,ImgInfo.BitsPerPixel,CodecsLoadByteOrder.BgrOrGray,3,3);
// Load the 2nd page (from the Multi-page TIFF file) on the temporary raster image TempImg2
IRasterImage TempImg2 = CodecsCommand.Load(@"c:\multipage.tif",ImgInfo.BitsPerPixel,CodecsLoadByteOrder.BgrOrGray,2,2);
try
{
// Move the 3rd page to the 2nd position in the Multi-page TIFF file
CodecsCommand.Save(TempImg1,@"c:\multipage.tif",ImgInfo.Format,TempImg1.BitsPerPixel,1,1,2,CodecsSavePageMode.Replace) ;
// Move the 2nd page to the 3rd position in the Multi-page TIFF file
CodecsCommand.Save(TempImg2,@"c:\multipage.tif",ImgInfo.Format,TempImg2.BitsPerPixel,1,1,3,CodecsSavePageMode.Replace);
}
catch(Exception e1)
{
MessageBox.Show(e1.Message.ToString());
}
}
+--------------------+
Please try the above code and let me know if this helps.
Thanks,
Maen Badwan
LEADTOOLS Technical Support