2

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.

1

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

pptx?web=1

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.

0

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? – user2493287 Jul 31 '15 at 14:21
  • All pages in SharePoint are Web Pages. Could You please explain a little more detailed? Best regards, Magnus – Magnus G Jul 31 '15 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" – sekhar Jul 31 '15 at 16:12
  • I don't see Preview like you. Is there any setting for it? – user2493287 Aug 3 '15 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 Aug 5 '15 at 7:40
0

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. – user2493287 Aug 3 '15 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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