This method inserts a page into a multipage tiff.

[Visual Basic] Public Function InsertPageIntoMultipageTiff(Val As Newtone.ImageKit.SaveFileType, SaveUrl As Image, insertPage As Integer) As Boolean
[C#] public bool InsertPageIntoMultipageTiff(Newtone.ImageKit.SaveFileType Val, Image SaveUrl, int insertPage);

Parameters

Val
     The image format of the inserted page (of type Newtone.ImageKit.SaveFileType)

SaveUrl
     The Tiff image into which a page will be inserted (must be a virtual path within the scope of the web application)

insertPage
     The page number where the page is inserted

Return Value

Returns True if successful. Returns False if unsuccessful.

Explanation

The InsertPageIntoMultipageTiff method inserts a page into a multipage tiff. The image loaded by the LoadImageFromFile method or by the LoadImageFromRawData method will be inserted into the Tiff file set in the SaveUrl parameter at the page location set in the insertPage parameter.

This method is enabled when the insertPage parameter is set to 1 or more. If the value of the insertPage parameter is greater than the number of pages in the multipage Tiff set in the SaveUrl parameter, the image will be added to the end of the multipage Tiff file.

If no image file is set in the SaveUrl parameter then the InsertPageIntoMultipageTiff will save the image loaded by the LoadImageFromFile method or by the LoadImageFromRawData method into the path set in the SaveUrl parameter as a single page Tiff image.

The InsertPageIntoMultipageTiff method is enabled when a Tiff image format is set in the Val parameter. It is possible for different pages in the multipage Tiff file to have different Tiff compression formats. If a file format other than a Tiff format is chosen for the Val parameter, if the insertPage parameter is set to 0 or less, or if the image file set in the SaveUrl parameter is not a Tiff file, then the InsertPageIntoMultipageTiff method will fail and return a value of False. The image loaded by the LoadImageFromFile method or by the LoadImageFromRawData method need not be a Tiff image but there are issues regarding the bitcount that must be considered. See explanation below.

Regarding tiff compression and image bitcounts:
Depending on the tiff compression choosen, images with certain bitcounts may not be able to be saved. In this case, errors may result. Below is a table listing the tiff compression and the bitcounts that are possible with that compression
 

Format Compatible Bitcount
Tiff (Uncompressed) 1, 4, 8, 16 (16 grayscale not supported), 24, 32.
Tiff (Group 3-1D) 1, 4, 8, 16 (16 grayscale not supported), 24, 32.
Important: On Windows Vista, only 1 bit images are supported. All other bitcounts will fail
Tiff (Group 4) 1, 4, 8, 16 (16 grayscale not supported), 24, 32.
Important: On Windows Vista, only 1 bit images are supported. All other bitcounts will fail
Tiff (Packbits) 1, 24.
Tiff (LZW) 1, 4, 8, 16 (16 grayscale not supported), 24, 32.

Tiff Group3-1D are the same format as MH. Tiff Group4 are the same format as MMR.
In Uncompressed and LZW formats, 16 bit images are converted to 24 bit images.

Examples

The following code will load a 1 bit BMP image, convert it to a Tiff G4 image and insert it into the multipage Tiff file as the

[Visual Basic.NET]
    ImageKit1.Url = "1bitBMP.bmp"
    ImageKit1.LoadImageFromFile(Newtone.ImageKit.LoadFileType.Load)
    ImageKit1.InsertPageIntoMultipageTiff(Newtone.ImageKit.SaveFileType.SaveTIFFNoncompressed, "001.Tif", 3)

[Visual C#.NET]
    ImageKit1.Url = "1bitBMP.bmp";
    ImageKit1.LoadImageFromFile(Newtone.ImageKit.LoadFileType.Load);
    ImageKit1.InsertPageIntoMultipageTiff(Newtone.ImageKit.SaveFileType.SaveTIFFNoncompressed, "001.Tif", 3)

Also See

ImageKit.WPF.Web.ImageKit Members | Newtone.ImageKit.WPF.Web.ImageKit

The ImageKit WPF is created by Newtone Corporation