Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Currently using WSS 3.0 and I am using page viewer web part to display a PDF file though when the page loads, users are prompted with the file download box to open or save the file.

Running Internet Explorer 8.

How can I get the PDF File to display without the File Download prompt?

share|improve this question
add comment

2 Answers

To open pdf file in browser use this code

                        WebClient client = new WebClient();
                        Byte[] buffer = client.DownloadData("address of pdf file");
                        Response.ContentType = "application/pdf";
                        Response.AddHeader("content-length", buffer.Length.ToString());
                        Response.BinaryWrite(buffer);
                        Response.Flush();
                        Response.End();
share|improve this answer
    
Thank you for the code though where do I insert it? The PDF file is currently viewed via Page Viewer webpart. –  Marina Nov 19 '12 at 12:43
    
Hi Marina no idea how you can done with page view webpart but you can do it with CEWP Please check this link sharepointsharon.com/2010/08/embedding-pdfs –  Vishal_Sharepoint Nov 19 '12 at 13:20
add comment

Please check if MiME type (Pdf) are added to the IIS . By default,it will be blocked to open directly in SharePoint .

If it happens only for specific users then it must be IE Settings .

Thanks, Aravind.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.