Y
Y
Yura Khlyan2016-02-18 17:11:18
Django
Yura Khlyan, 2016-02-18 17:11:18

Output PDF on a website page?

Good day.
I have a File field on my product. This field uploads a PDF file. How can I display this document on the page?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2016-02-18
@sim3x

Inside the page in no way
Possible only on a separate page
{{ model_name.pdf_field_name.url }}

A
artemalexpetrov, 2016-02-18
@artemalexpetrov

You can use the iframe and pdfjs from Mozilla
PDF.js: https://github.com/mozilla/pdf.js/
UPD: There is another way to embed the GoogleDocs document viewer on the page.

<iframe src="http://docs.google.com/gview?url={{ model.download_url }}&embedded=true"/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question