VBScript to combine tif documents

Asked By 10 points N/A Posted on -
qa-featured

Hi All,

Is there any way to automate the combining of multiple tiff files to one, a friend of mine told that there may be possible way to have it using VBScript.

Can anyone help me to get me the VBScript to combine tif documents to a single file.

Thank You,

Mike Atherton

SHARE
Answered By 5 points N/A #189095

VBScript to combine tif documents

qa-featured

 

Hey Mr. Atherton,    

I have a solution to combine multiple .tif documents using java. You will need Java Advanced Imaging (JAI) API for this. In this code, I am converting tiff images to java.awt.image.BufferedImage and in the second part, converting them back to tiff.

1st part:
BufferedImage image[] = new BufferedImage[numImages];
for (int i = 0; i < numImages; i++) {
    SeekableStream ss = new FileSeekableStream(input_dir + file[i]);
    ImageDecoder decoder = ImageCodec.createImageDecoder("tiff", ss, null);
    PlanarImage op = new NullOpImage(decoder.decodeAsRenderedImage(0), 
            null, OpImage.OP_IO_BOUND, null);
    image[i] = op.getAsBufferedImage();
}
 
2nd part:
TIFFEncode abc = new TIFFEncodeParam();
OutputStream out = new FileOutputStream(output_dir + image_name + ".tif"); 
ImageEncoder encoder = ImageCodec.createImageEncoder("tiff", out, abc);
Vector vector = new Vector();   
for (int i = 0; i < numImages; i++) {
    vector.add(image[i]); 
}
abc.setExtraImages(vector.iterator()); 
encoder.encode(image[0]); 
out.close(); 
 
Apart from this, you can try free utility software available for this purpose.
You can try “FAXTOOL” – a simple software where you can drag and drop images to combine or split. Or go to the following link:
 
http://www.a-pdf.com/faq/can-i-merge-multiple-tiff-files-to-a-single-image.htm

 

Along with the free software you will also get a tutorial.

Related Questions