You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to display PDFs inside a Django web application using pdf-js. For this, I use the iframe tag to use the PDF js default viewer. Django displays an Error 404 saying that web/viewer did not match any of the url patters used in the Django web application. I have also tried to add a view that renders the web/viewer.html file but still the pdf could not be displayed. Can you please help me fix this issue, or clarify how to integrate pdf js default viewer in a django web application.
When I add the following view in my views.py file.
If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us in the Matrix room -- keep in mind that just code snippets won't help us troubleshoot the problem.
Attach (recommended) or Link to PDF file here:
Configuration:
I am trying to display PDFs inside a Django web application using pdf-js. For this, I use the iframe tag to use the PDF js default viewer. Django displays an Error 404 saying that web/viewer did not match any of the url patters used in the Django web application. I have also tried to add a view that renders the web/viewer.html file but still the pdf could not be displayed. Can you please help me fix this issue, or clarify how to integrate pdf js default viewer in a django web application.
When I add the following view in my views.py file.
def pdf_View(request): return render(request,'app/web/viewer.html')
I get no error, but, the PDF is not displayed, only the buttons of pdf navigation bar (next, previous pages, zoom in,out ...).
It could be very helpful if someone can adress this issue, or make a small tutorial on how to integrate pdf-js with a Django web application.
The text was updated successfully, but these errors were encountered: