Embed PDF with Django

0

Good afternoon in my application users can upload PDF files, whose route is stored in the user model. Now my question is what plugin I recommend to be able to embed and visualize these PDF files in a template.

I've been trying with Google Docs Reader but it has given me the URL because it is a local site

<iframe src="http://docs.google.com/viewer?url=AQUÍ URL PDF O DOCUMENTO&embedded=true" width="600" height="780" style="border: none;">  </iframe>

I appreciate your cooperation

    
asked by jhon1946 29.05.2017 в 19:50
source

2 answers

1

Try using the following code, it works for me using local files and online files:

<embed id='pdf' src="nombredelpdf.pdf"></embed>

The <embed/> tag is HTML5. As standard it should work in all browsers with HTML5 and PDF support, and with local and external files.

More information about embed on the W3C specification (text in English).

    
answered by 07.08.2017 / 05:10
source
0

I recommend the book Django By Example, where you work with the WeasyPrint bookstore and put practical examples. Note is in English. Another library is Reportlab looking for the official documentation link . greetings

    
answered by 29.05.2017 в 20:08