Hey guys can anybody help me to figure out how to convert the .tiff format file to .doc format.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hey guys can anybody help me to figure out how to convert the .tiff format file to .doc format.
You'll have to use third party packages or write the code yourself.
If you don't understand my answer, don't ignore it, ask a question.
can u explain it little bit more, i have no idea to start writing this particular application.
Any links that may help me, please send me the proper documentation links
Thanks
If you are going to write the code (instead of using a third party package) you need to get complete documentation for the formats of the files so you can read one file, convert it and write the other file. The formats for the files have nothing to do with java programming.
The API doc for the java classes useful for reading and writing files is at: Java Platform SE 7
If you don't understand my answer, don't ignore it, ask a question.
here is my code in which i was successful to convert the tiff file to the jpeg, but i still not getting the idea to convert that in to the text..
please help me and guide me little bit more to achieve my goal.
import java.io.File;
import java.io.FileOutputStream;
import java.awt.image.RenderedImage;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import javax.media.jai.NullOpImage;
import javax.media.jai.OpImage;
import com.sun.media.jai.codec.SeekableStream;
import com.sun.media.jai.codec.FileSeekableStream;
import com.sun.media.jai.codec.TIFFDecodeParam;
import com.sun.media.jai.codec.ImageDecoder;
import com.sun.media.jai.codec.ImageCodec;
public class tiffile {
public static void main(String args[]) {
File file = new File("d://hello.tif");
try {
SeekableStream s = new FileSeekableStream(file);
TIFFDecodeParam param = null;
ImageDecoder dec = ImageCodec.createImageDecoder("tiff", s, param);
RenderedImage op = new NullOpImage(dec.decodeAsRenderedImage(0),
null,
OpImage.OP_IO_BOUND,
null);
FileOutputStream fos = new FileOutputStream("d://sample.jpeg");
JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder(fos);
jpeg.encode(op.getData());
fos.close();
}
catch (java.io.IOException ioe) {
System.out.println(ioe);
}
}
}
Please edit your post and wrap your code with code tags:
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.
The posted code can't be compiled for testing because of many missing packages.
If you don't understand my answer, don't ignore it, ask a question.