Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open newly-created PDF in new browser instance 1

Status
Not open for further replies.

tigerjade

Programmer
Mar 17, 2004
237
US
I'm using iTextSharp to create PDFs with this application. It'll write the PDF just fine, but doesn't open it. How can I use code-behind ('cause this is a class that doesn't interact with the user past their initial request) to open the newly-created PDF in a new browser instance?

Thanks!

tigerjade

"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
Try streaming the content directly through the response object.

Addheader will allow you to specify a file name and then just stream the file to the browser. They browser should pop the open or save message.

Brian Begy
Chicago Data Solutions
 
Thanks, Brian! Can you point me to an example? MSDN documentation is pretty light on using AddHeader. :(

thanks!

tigerjade

"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
I found something; now I just have to figure out how to get the application to release the PDF so that the AddHeader can get 'hold of it.

Thanks again!

tigerjade

"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top