Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powerpoint viewer for react?

I searched a lot for this but couldn't find any package or a guide on how to view a ".ppt" file on a webpage using react.js.

I'm allowing the user to upload a ".ppt" file, and I want him to be able to view that "Powerpoint" file in a web page, is that even possible?

I tried the following but it didn't work ...

<iframe
    src={`https://view.officeapps.live.com/op/embed.aspx?src=[${linkToPPTFile}]`}
    width="100%"
    height="600px"
    frameBorder="0"
></iframe>

Any help will be appreciated.

like image 999
Ruby Avatar asked Feb 07 '20 15:02

Ruby


2 Answers

I also had this similar issue. The problem is with this part src=[${linkToPPTFile}] of your iframe src. Remove the box brackets. It should just be:

<iframe
    src={`https://view.officeapps.live.com/op/embed.aspx?src=${linkToPPTFile}`}
    width="100%"
    height="600px"
    frameBorder="0"
>
</iframe>
like image 89
Allan Mogusu Avatar answered Sep 17 '22 14:09

Allan Mogusu


It appears that particular Microsoft embed link no longer works. One way to make it happen is to store the PowerPoint file in a public folder online and create an embed code in PowerPoint for the Web (https://www.office.com/launch/powerpoint). The embed code should include an <iframe/> tag.

There's more information about the process here: https://support.office.com/en-us/article/Embed-a-presentation-in-a-web-page-or-blog-19668A1D-2299-4AF3-91E1-AE57AF723A60

like image 40
Ed Lucas Avatar answered Sep 19 '22 14:09

Ed Lucas