File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to open word and pdf document in the browser

 
Bonny Sen
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friend,

Could any one please suggest a way of opening/viewing a word file or a pdf file in the browser. I am using JBoss 4 server and struts 1.2

The file can be opened in 2 ways:

1. Display the file name on the jsp page as a hyper link. On clicking the link the appropriate file should be opened for reading in the same browser.

2. There would be a radio button against the file name and a "View" submit button. Selecting the file by checking the radio button and clicking on the "View" button should open the file in the browser.

Please help.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33684
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bonny,
While either approach is fine, I always prefer an approach that shows the user what type of file they will be getting upon clicking. In this case, it sounds like #2.

Note that whether it opens in the browser is dependent on the user's configuration. For example, I have .doc files set to prompt for download on my computer.
 
Swaroop Kunduru
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone Please help with a code snappet to open an MsWord using struts framework.

Thanks in advance.

Regards,

Swaroop Kunduru.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts is server-side library, while documents tend to be opened on the client; what are you trying to do - stream the document to the client?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic