Click here to Skip to main content
15,947,389 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On button click I had written a code to open pdf file which is working properly only the thing I want is open in acrobat reader instead of asking open/save dialog box .
I had used process.start() but it is not working on IIS . I don't want in another browser .

and

Can I disable save,copy,print of pdf file.


C#
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + filepath);
Response.TransmitFile(filepath);
Response.End();
Posted
Updated 10-Sep-13 0:46am
v5

Make sure you add the following headers in the reponse:
Content-type: application/pdf<br />
Content-Disposition: inline; filename="yourfile.pdf"


Actual opening the pdf in a reader is still up to the client browser. Depending on what program is associated with pdf (if any) and the user didn't disable it.

Good luck!
 
Share this answer
 
Comments
Member 10241729 10-Sep-13 5:12am    
I had used it but still open/save dialog box is seen.
E.F. Nijboer 10-Sep-13 5:26am    
Could you click "improve question" and add your code? Did you also try another browser?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900