Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2009, 01:34 PM
Member
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0
sandeepk84@gmail.com is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-04-2009, 04:51 PM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 838
Rep Power: 2
OrangeDog is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-04-2009, 07:15 PM
Member
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0
sandeepk84@gmail.com is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-04-2009, 11:29 PM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 838
Rep Power: 2
OrangeDog is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Tags
file preview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating layer on images ? Qmalq AWT / Swing 2 01-27-2009 11:20 PM
Creating a flat tool bar with images Java Tip SWT 0 07-02-2008 09:10 PM
Creating .Jar files Deathmonger New To Java 6 06-23-2008 12:59 AM
Creating JAR files - 2 JavaForums Java Blogs 0 04-14-2008 06:11 PM
Creating ZIP files Java Tip Java Tips 0 03-03-2008 06:14 PM


All times are GMT +2. The time now is 03:41 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org