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.

Results 1 to 6 of 6

Thread: tiff to doc format

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default tiff to doc format

    Hey guys can anybody help me to figure out how to convert the .tiff format file to .doc format.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,717
    Thanks
    45
    Thanked 1,974 Times in 1,948 Posts

    Default Re: tiff 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.

  3. #3
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: tiff to doc format

    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

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,717
    Thanks
    45
    Thanked 1,974 Times in 1,948 Posts

    Default Re: tiff to doc format

    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.

  5. #5
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: tiff to doc format

    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);
    }
    }
    }

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,717
    Thanks
    45
    Thanked 1,974 Times in 1,948 Posts

    Default Re: tiff to doc format

    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.

Similar Threads

  1. PDF to Tiff Converison
    By aneelsahu in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: February 13th, 2014, 04:33 AM
  2. JRE 1.5 doc question
    By Karilee in forum Java Theory & Questions
    Replies: 1
    Last Post: June 17th, 2010, 03:26 AM
  3. String to XML doc
    By rukwa in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: March 3rd, 2010, 11:35 AM
  4. Text to Tiff Image
    By sreddy_k in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: August 13th, 2009, 12:36 AM
  5. How to import an .tiff image in JSP?
    By jazz2k8 in forum JavaServer Pages: JSP & JSTL
    Replies: 4
    Last Post: May 12th, 2008, 05:55 AM