Writing and Reading Multipage Files (Visual Basic Script)

Take the following steps to create a multipage file, then load and display the images from the file. Only TIFF (MPT) and PCX (DCX) formats support multipage files:

1.

Start with the project that you created in Loading and Displaying an Image.

2.

Add the following code between the <BODY> </BODY> tags to add another Raster IO object and Raster View control:

<OBJECT ID="RasterIO2" NAME="RasterIO2" 
   CLASSID="CLSID:0014070E-B1BA-11CE-ABC6-F5B2E79D9E3F"
   CODEBASE="path to CAB file/Ltrio14n.cab">
   <P>This is not supported in the web browser.</P>
</OBJECT><BR>

<OBJECT ID="LEADRasterView2" NAME="LEADRasterView2" 
   CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
   CODEBASE="path to CAB file/Ltrvw14n.cab" 
   ALIGN="baseline" 
   BORDER="0"
   WIDTH="50%" 
   HEIGHT="90%">
   <P>This is not supported in the web browser.</P>
</OBJECT><BR>

3.

Modify the LoadImage() procedure as follows:

Dim FILE_TIF
Dim SAVE_OVERWRITE
Dim SAVE_APPEND

FILE_TIF = 3
SAVE_OVERWRITE = 0
SAVE_APPEND = 1  

'Load the bitmaps. These hard-coded path names may be different on your system. 
RasterIO1.Load LeadRasterView1.Raster, "c:\Image1.jpg", 0, 0, 1
RasterIO2.Load LEADRasterView2.Raster, "c:\Image2.jpg", 0, 0, 1
 
'Save the bitmaps to a single multipage TIFF file
RasterIO1.Save LeadRasterView1.Raster, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE
RasterIO2.Save LEADRasterView2.Raster, "c:\combined.tif", FILE_TIF, 24, 0, SAVE_APPEND
  
'Load the bitmaps from the multipage TIFF file
RasterIO1.Load LeadRasterView1.Raster, "c:\combined.tif", 24, 1, 1
RasterIO2.Load LEADRasterView2.Raster, "c:\combined.tif", 24, 2, 1

4.

Run your page to test it.