Open stream as pdf

G

Guest

Hi, I'm using this code to open a pdf BinaryStream from database as pdf
Document and it's working :
Response.AddHeader("Content-Disposition", "attachment;filename=File.pdf");
Response.ContentType = "application/pdf";
Response.BinaryWrite(myfile);
Response.Flush();
Response.Close();

The only thing that the browser is poping up a message to "Open", "Save" or
"Cancel" document before openning it.
So, I change the top linr of code with:
Response.AddHeader("Content-Disposition", "inline;filename=File.pdf");
and the problem is that the document is opened in the same main page.

So, how can I force the generated PDF Document to Just open up directly in a
new page, when running the code!!?


Thanks
 
A

Aidy

You need to change the link to your page from

<a href="PDFWriter.aspx">

to

<a href="PDFWriter.aspx" target="_blank">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top