Split and Cut Multipage TIFF Images

 

You can delete a page from a TIFF file with the DeleteTiffImage function/method of the BiTIFF DLL/OCX. SplitTiffFile can be used for cutting a multipage TIFF image at a specified page.  CutTiffFile splits a multipage TIFF files into single page TIFF images.

 

[C++]

 

/* Split a multipage TIFF image */

 

#include “BiTiff.h”

BOOL bRet;

 

char szDest[MAX_PATH], szSource[MAX_PATH];

 

strcpy(szDest, “C:\\Images\\Dest.tif”);

strcpy(szSource, C:\\Images\\Source.tif”);

 

/* Split the TIFF file at specified page

   1. parameter: Source TIFF file. Must be multipage

   2. parameter: The new TIFF file generated after the

  split

   3. parameter: Position of the split

   4. parameter: Call back function, a developers can

display a progress bar.

5. parameter: This pointer is the third parameter of the

lpCallBackFunction. */

 

bRet = SplitTiffFile(szSource, szDest, 3, NULL, NULL);

 

if (!bRet)

{

            // Error

}

 

[VB]

 

‘ Split a Multipage TIFF file

 

Dim bRet As Boolean

Dim szSource As String

Dim szDest As String

Dim BITiffobj As Object

 

szSource = “C:\Images\Source.tif”

szDest = “C:\Images\Dest.tif”

 

Set BITiffobj = CreateObject("BITIFF.BITiffCtrl.1")

 

bRet = BITiffobj.SplitTiffFile(szSource, szDest, 3)

 

Note: Use the SplitTiffProgress event for get an event after a page has splitted.

 

[C#]

 

/* Split a Multipage TIFF file */

 

bool bRet;

string szSource, szDest;

 

szSource = “C:\\Images\\Source.tif”;

szDest = “C:\\Images\\Dest.tif”;

 

bRet = BiTiff.SplitTiffFile(szSource, szDest, 3);

 

if (!bRet)

{

            // Error

}

 

Note: Use the SplitTiffProgress event for get an event after a page has split.