• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

opening a created PDF in internet browser

 
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
 
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...!
 
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....!!!
 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic