Discussion:
Embedding pdfs in Django
Vikas Sri
2018-11-11 18:09:48 UTC
Permalink
I am preparing learning tutorial application in Django, which will contain
PDF's that I need to display in my templates. I tried <embed>, <iframe>
etc but nothing worked. Do I need to install something to make it work?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bf37ceb4-1ab0-4ec7-816d-20070fe767c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
C. Kirby
2018-11-13 15:02:59 UTC
Permalink
I'm pretty sure that you can't render pdf to the browser. You can either
provide links for the users to download and view the pdfs, or extract the
content from the pdfs and put that in your templates.

You may be able to get what you want with javascript. I can't vouch for
this, but I found it searching -
https://pspdfkit.com/blog/2018/render-pdfs-in-the-browser-with-pdf-js/

good luck
Post by Vikas Sri
I am preparing learning tutorial application in Django, which will contain
PDF's that I need to display in my templates. I tried <embed>, <iframe>
etc but nothing worked. Do I need to install something to make it work?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c9aae107-7deb-46e7-b1db-8c35592049de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Siim Märtmaa
2018-11-13 15:32:07 UTC
Permalink
I am preparing learning tutorial application in Django, which will contain PDF's that I need to display in my templates. I tried <embed>, <iframe> etc but nothing worked. Do I need to install something to make it work?
Here is example and demo with pdf and <object> tag
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object

It should also work with iframe
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BohZETe86xHUWsdPR5tOs04NpF1948_EYbCs3n8XNosNvVSKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
g***@u4sd.org
2018-11-13 18:01:49 UTC
Permalink
that is nice
Post by Vikas Sri
I am preparing learning tutorial application in Django, which will contain
PDF's that I need to display in my templates. I tried <embed>, <iframe>
etc but nothing worked. Do I need to install something to make it work?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5b1793c1-e620-45ae-8878-b94c037fd6d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g***@u4sd.org
2018-11-13 18:02:01 UTC
Permalink
great
Post by Vikas Sri
I am preparing learning tutorial application in Django, which will contain
PDF's that I need to display in my templates. I tried <embed>, <iframe>
etc but nothing worked. Do I need to install something to make it work?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/08abdd6b-2fd1-495f-9bb8-85f724a0cff7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...