disable download pdf embed tag

1145 views html

I'm using php, I'm creating a detailed view page of a profile, which has a pdf document, I use the embed tag to display it, but when opened it does not display the pdf file and Automatically download the file. Therefore the user can not see the pdf file displayed. Is there a way to solve this problem? Excuse me for this stupid question!

<embed src="/vh/assets/image/java.pdf" type="application/pdf" width="500" height="500"/>

answered question

I'm using Google PDF viewer for that and it's running very well ! The src should be something like http://docs.google.com/gview?url=YOUR_PDF_URL

2 Answers


The problem is that <embed> is not a void element. You should have the tag like this:

<embed src="/vh/assets/image/java.pdf" type="application/pdf" width="500" height="500"></embed>

This should now work.

posted this

You can refer to w3schools embed tag,It is an html single tag,I can display pdf normally in chrome and firefox.Maybe you can check if your src is correct.

posted this

Have an answer?


Please login first before posting an answer.