0

I am not expert in Django, but I am doing a web site where I would like to embed a ppt, which is saved into the static folder. The code of the html is:

{% extends 'base.html' %}
{% load static %}

{% block content %}
    <iframe src="{% static 'ppt/pptexample.pptx' %}" style="width:800px; height:600px;" frameborder="0"/>
{% endblock %}

When I load the site, the ppt is perfectly downloaded, but I would like to visualise it online. Then, I have tried to add embedded=true, that is to say {% static 'ppt/pptexample.pptx' %}&embedded=true, which did not work. The error message is:

ppt\pptexample.pptx&embedded=true' could not be found

Debug mode states that Request URL is:

http://127.0.0.1:8000/static/ppt/pptexample.pptx&embedded%3Dtrue

Could you recommend me or letting me know how to embed such a PowerPoint document in the Web?

Many thanks in advance

Jose Hdez
  • 2,297
  • 7
  • 38
  • 52
  • `which did not work` please elaborate the situation: error message, static file url works but iframe not rendered? – Ivan Starostin May 27 '22 at 11:05
  • 1
    I don't feel it's a django issues (as far as the little code you shown) but more an html issue. You can use google doc to render a dynamic presentation in your html file See: https://stackoverflow.com/questions/39855/embed-a-powerpoint-presentation-into-html#:~:text=92,from%20your%20page%3A – Carlo May 27 '22 at 11:11
  • 1
    I think by iframe does not render **pptx** becaues it's not native to browser you can use [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object) tag to render it – Ankit Tiwari May 27 '22 at 11:12
  • Thanks for the answers, indeed, I finally uploaded the ppts into a OneDrive account and, then, I shared it. Thanks all for your comments. – Jose Hdez May 31 '22 at 10:37

0 Answers0