Suppose, I have many different types documents (.pdf, .doc, .xls., csv., .png etc) in my library. I have to view document in SharePoint web page or any web part.

Do we have something like that, we can pass document url to that page or web part and we can see document?

I search a lot but not find anything, tried page viewer web part but It can show ".pdf" file but other (.doc, .ppt, .csv etc) can not.

Thanks in advance.

3 Answers 3


I guarantee you that it works if you have Office web applications. Page viewer do works with power point, just select web page instead of file. The link should carry at the end


All other files it works if you take the code (see pic above) that you find in the tiny icon next to the page 1 of 1 line. There you find the code to embed using a 'insert code' dialogue box in a wiki page.


The closest you get is this. The preview functionality works just great and i think that could be the solution for You. Just click the three dots and the Preview will show You the Office file ( or PDF). Regards, Magnus enter image description here

  • Thanks for reply but can't we preview in web page? Commented Jul 31, 2015 at 14:21
  • All pages in SharePoint are Web Pages. Could You please explain a little more detailed? Best regards, Magnus
    – Magnus G
    Commented Jul 31, 2015 at 14:23
  • I think all you want is to open the doc in office web access. insert an iframe/pageviewer in your page and paste the document url append ?web=1 at the end ex: "server/site/doclib/filename.ext?web=1" Commented Jul 31, 2015 at 16:12
  • I don't see Preview like you. Is there any setting for it? Commented Aug 3, 2015 at 9:23
  • @user2493287 , could You please create add a Print Screen here so that i can see how it looks. That makes it easier to understand. BR, Magnus
    – Magnus G
    Commented Aug 5, 2015 at 7:40

I have personally used the Content Editor Web Part (Located under Media and Content) to display various documents within the page (no need to have the page be opened on an entirely different page) maybe this is what you would want?

To do this, add the Content Editor on your page. Select "Edit Web Part" then click on the text that appears on the web part ("Click here to add new content").

At this point it should look like you are about to type in a text box. Now click "Edit Source" on the Format Text ribbon. This will edit the HTML within the Content Editor itself instead of the entirety of the page.

Now insert this code:

<object><embed width="850" height="850" src="..." type="application/pdf"></object> 

As you can see there is a src"..." where the ellipses are put the link to your document or image or whatever that you have stored within your SP site. (this might take some playing with the link). This case also is for a pdf and you might need to change that application/pdf - might work with any document type however.

  • Thanks for reply. I need to show all kind of document. Content editor shows only .pdf file. Commented Aug 3, 2015 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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