Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

opening a created PDF in internet browser

 
Rekha Pande
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try writing the file to the ServletOutputStream of your response. :roll:
[ July 21, 2004: Message edited by: arnel nicolas ]
 
Rekha Pande
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.. I tried with the iframe Tag ...and it worked perfectly...... Thanxs....anupreet and all....!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic