wood burning stoves 2.0*
The moose likes JSP and the fly likes opening a created PDF in internet browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "opening a created PDF in internet browser" Watch "opening a created PDF in internet browser" New topic
Author

opening a created PDF in internet browser

Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
Hi all...

I'm creating a PDF file by passing parameters -> JSP -> Java program... now this file is saved on the server...

What i want it that the button through which i'm generating the PDF ...Is there any one that through this same button i can open that created PDF file in the web browser so that the user can click save as and then store it on his / her PC.

Any suggestions...?? :roll: :roll:

Thanxs in advance
arnel nicolas
Ranch Hand

Joined: Dec 16, 2003
Posts: 149
Try writing the file to the ServletOutputStream of your response. :roll:
[ July 21, 2004: Message edited by: arnel nicolas ]
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
But i'm using jsp ... shall i be directing the JSP file to a servlet and over there call the PDF file for opening in the broswer .... please codes will be appreciated..!!!

Thnxs...!
Anupreet Arora
Ranch Hand

Joined: Jun 17, 2003
Posts: 81
If you know the name and location of the pdf on the server, and if that is in the webapp on your server, then you can probably use a frame in your JSP, and try to give the name and location of the pdf in the source attribute of the frame tag.

This will force the pdf to open inside the browser.

Hope this helps !!

Rgds,
Anupreet
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
Hi Anupreet & all

You had mentioned to call the pdf file from a frame..... well i'm not quite aware as to how to go bout this thing... so can u plz write a code..so i'll have a better idea.... and yes... i know the pdf file name and the server location...
How i would call it from a frame.....plz guide me on this issue...!

Thnxs...!
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
Ok.. I tried with the iframe Tag ...and it worked perfectly...... Thanxs....anupreet and all....!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: opening a created PDF in internet browser
 
Similar Threads
How to open an PDF file from Java Application
How to open word and pdf document in the browser
how to save a webpage with struts code as pdf in java?
how to save a jsp page as pdf in java?
Printing through a web application