File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes convert any documentinto jpg format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "convert any documentinto jpg format" Watch "convert any documentinto jpg format" New topic
Author

convert any documentinto jpg format

kanuru shankar
Greenhorn

Joined: Nov 09, 2009
Posts: 6
hi to all

i am developing a product .in that i have a requirement to view all the documents in my viewer.


i tried alot to do this one.but i didnt get any solution.

at last i am trying to convert all documents into jpg format .
please help me to covert into jpg or any sugession to view the documents in browser.

i tried poi,j-integra to view .doc,.pdf. but those are opening in their softwares.

i am trying to open in my viewer nothing but in browser .


please help me.very urgent

thanks in advance
regards
SHANKAR RAO
kanurushankar@gmail.com



David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

please define 'all documents'. is this a servlet question or run through a servlet?
There is an open source HTML parser that is able to render wen pages into images (or so I believe) called cobra, is this what you need?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
Very likely you're going to have to use different libraries for the various document types. PDFRenderer (on dev.java.net) can be used for displaying PDFs.

I'm not aware of a Java component that can display DOC files; you could use the JODConverter library to convert it to something that you know how to display.


Ping & DNS - my free Android networking tools app
kanuru shankar
Greenhorn

Joined: Nov 09, 2009
Posts: 6
thank for your response.i want to open .doc.,.xls,pdf,all extensions in browser how can i achieve this using java. is this possible to view all these documents in browser
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
What does Java have to do with the browser? Are you thinking of implementing this as part of an applet or a JavaWebStart application?

Note that even though some file types can be displayed in the browser (notably PDF, DOC, XLS), this depends on appropriate viewer software being installed, and the user having set the browser to display those file types instead of saving them to disk. The web app can't force the browser it display them.

Maybe it's time to take a step back and ask what the reason for wanting to display all those formats in the browser is?
kanuru shankar
Greenhorn

Joined: Nov 09, 2009
Posts: 6
hi to all. i am also eable to open these pdf and xls,doc of 2003 version. but i am unable to open all the extensions in browser.but my company requirement is we have to open all the documents in our own viewr wheather it is browser or applet or some other. their intention is nobody can manipulate these document which is stored in our software.

actually my project is document management system.so we have to save the document in our own format.and at the time of retrival it should be open in our own viewer. i am not getting the way from where should i start to save the document and retreve the document in our own format.

please help me to do this .i am using struts 1.2 and ajax and oracle.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
You still haven't said what "all" those extensions are, but if you mean that literally, then browsers simply won't be able to do that. There's only a limited range of document formats that browsers (with or without plugins) know how to make sense of.

their intention is nobody can manipulate these document which is stored in our software.

I don't understand this. The original is in the DMS, it *can't* be changed by anything the user does, unless the DMS lets the user save changes back to the system. So the basic premise sounds a bit flawed to me.

we have to save the document in our own format.and at the time of retrival it should be open in our own viewer. i am not getting the way from where should i start to save the document and retreve the document in our own format.

OK, so what you're saying is that actually you do *not* have to open and display all those formats - you need to convert them into your own internal format, and then display that; is that correct? If that's the case, what step are you having difficulties with - converting several document formats to your internal format, or displaying the internal format? What do you have so far?
kanuru shankar
Greenhorn

Joined: Nov 09, 2009
Posts: 6
thank you Ulf Dittmer ,

actually my company is doing a product which is named as DMS.in that they or asking to store all the documents (means all the extensions of documents like .doc.,.xls.,.pdf,.dwg,.ppt,.pps .....etc total 23 or 25 extensions are there approximatly) in database with internat format (using our own encryption rules and our own extension). how can i encrypt that msoffice documents and pdfs and auto cad docs etc using java.

after storing how can i retrive this encrypted document in our own viewer not in browser.because they are asking their menubar on the viewer.by using this menu bar only user can manipulate all these documents mentioned above.

simply they are asking to create one more viewer wich is opening all the extensions of documents .

is it possible to open all the documts in our own viewer without knowing their decryption format.

i am not understanding what to do .please help me i am hopeless

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
Encryption/decryption is done in Java through an API called JCE (which is part of JSE). You can find some links about it in the SecurityFaq; maybe start with "Using AES with JCE".

You don't say what you mean by "internal format" - I don't see how that could possibly accommodate all those formats you mention, but I guess you and your company must have thought that through. Not understanding how that would work, I can't comment on it.

What is the "viewer"? A standalone application? An applet? A JavaWebStart application? Something else?

I'm also getting the feeling that you're not clear about several of the requirements; I suggest that you spend serious time with product management (or whoever came up with the requirements) in order to fully understand them.
kanuru shankar
Greenhorn

Joined: Nov 09, 2009
Posts: 6
thank you for your sugessions.
i am also not understanding how can we open a document which is created with other extension. actual requrimnt is open any type of extions document in our own viewer wheather it is applet or browser or someother else but we have to make that viewer with our own menu bars,tools and manipulations.means if once the document is attached in to this software nobody can view or open this without installing the same software. for ex if .doc is attached by user into our software.it should open in our own viewer.it should not open any where without this viewer.if the user having msword also he could not open this.
company is not prividing any project management ,and team also.he is saying that do R&D to open that.how can i .i am not understanding.
is it possible.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
Well, if you don't have guidance on what you're supposed to do, then there's nothing much we can do about that. It sounds as if you need to write a viewer application as an applet or JavaWebStart application, though.

As I said, there's no single library that can open and display all file types. Some of the ones you mention can be handled by libraries like Apache POI or PDFRenderer, but it'll be a lot of work.
kanuru shankar
Greenhorn

Joined: Nov 09, 2009
Posts: 6
is there any way todisplay the content of .docx,.xlsx(msoffice 2007)versions in browser.if iam using iframes i am opening that documents in that frame without their menubars toolbars . now ineed to display the documents without their menubars and toolbars and task bars in browser.
if it will be done then i will create a jsp with my menubars after that i will display the content of that document.

it will fullfill my requirement.i.e we have to open all the documents without their menubars and alletc.
only content we have to open on browser.

i did this one but i am unable to open .dwg(autocad drawing )in browser and also msoffice 2007 version documents.

please tell me the way to open all that documents content only.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert any documentinto jpg format