Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2007
    Posts
    5
    Rep Power
    0

    Default Creating preview images of files in java

    Hi all,

    How I can convert the first page of a file into an image?
    My application allows users to upload files. To see it, as of now, users have
    to download and see, which is hard to do.

    So I need to create a preview image
    of the uploaded file which can be of any type(PDF, doc, txt, xls, ppt, etc.).
    How can I do this? I need to show only the first page of the file as an image.

    For image files which are uploaded, I am showing a thumb nail size preview,
    but for other file types I have to get a way. Even if the preview is not in the for of an image, it will be fine for me. My only aim is to show some content of the file to the user so that he will get an idea of the file. How can I do this?

    Expecting some help,

    Thanks and regards,
    Sandeep.

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    You need a separate rendering engine for every file type you want to display. While this is easy for txt, the Office formats will require 3rd party libraries.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    Join Date
    Oct 2007
    Posts
    5
    Rep Power
    0

    Default

    Thanks for the reply... i got the point.
    can you suggest some? how about using some Linux utilities for creating the preview?
    The only problem will be, some utilities will need OpenOffice to be there for generating the preview. But I haven't worked with them yet. Have to try. I wanted the best way to implement this.
    User can upload any type of file. Its(file type) not restricted. Having separate rendering engines in this case will be a problem.

    Thanks and regards,
    Sandeep.

  4. #4
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    There is a Java library for working with Office documents, but I don't think it does rendering. If you're lucky they'll have a thumbnail saved with them.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

Similar Threads

  1. Creating layer on images ?
    By Qmalq in forum AWT / Swing
    Replies: 2
    Last Post: 01-27-2009, 10:20 PM
  2. Creating a flat tool bar with images
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-02-2008, 08:10 PM
  3. Creating .Jar files
    By Deathmonger in forum New To Java
    Replies: 6
    Last Post: 06-22-2008, 11:59 PM
  4. Creating ZIP files
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-03-2008, 05:14 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •