Writing and Reading Multipage Files (ASP - JavaScript)
This example demonstrates how to create a multipage file on the server, then load and display the images from that file. Only TIFF (MPT) and PCX (DCX) formats support multipage files:
<%@ Language=JavaScript %>
<%
var FILE_TIF = 3;
var FILE_JFIF = 10;
var SAVE_OVERWRITE = 0;
var SAVE_APPEND = 1;
var RasterObj1 = Server.CreateObject("LEADRaster.LEADRaster");
var RasterObj2 = Server.CreateObject("LEADRaster.LEADRaster");
var RasterIO1 = Server.CreateObject("LEADRasterIO.LEADRasterIO");
var RasterIO2 = Server.CreateObject("LEADRasterIO.LEADRasterIO");
//Load the bitmaps. These hard-coded path names may be different on your system.
RasterIO1.Load(RasterObj1, "i:\\a\\pic\\20020816demo3.jpg", 0, 0, 1);
RasterIO2.Load(RasterObj2, "i:\\a\\pic\\20020816demo2.jpg", 0, 0, 1);
//Save the bitmaps to a single multipage TIFF file
RasterIO1.Save(RasterObj1, "c:\\combined.tif", FILE_TIF, 24, 0, SAVE_OVERWRITE);
RasterIO2.Save(RasterObj2, "c:\\combined.tif", FILE_TIF, 24, 0, SAVE_APPEND);
//Load the bitmaps from the multipage TIFF file
RasterIO1.Load(RasterObj1, "c:\\combined.tif", 24, 1, 1);
RasterIO2.Load(RasterObj2, "c:\\combined.tif", 24, 2, 1);
//Save the bitmaps to separate JPEG files to display them in the browser window.
RasterIO1.Save(RasterObj1, "c:\\temp1.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE);
RasterIO2.Save(RasterObj2, "c:\\temp2.jpg", FILE_JFIF, 24, 2, SAVE_OVERWRITE);
Response.Write("<IMG SRC='c:\\temp1.jpg'>");
Response.Write("<IMG SRC='c:\\temp2.jpg'>");
%>