An .aspx page has a .pdf file in it, like this: <embed src="http://.../ShowPdf.aspx?id=1" type="application/pdf">. Chrome just shows a “Loading” image and hangs without displaying the pdf (chrome pdf viewer and adobe plugin both don’t work). Other browsers open the pdf. Any ideas?
An .aspx page has a .pdf file in it, like this: <embed src=http://…/ShowPdf.aspx?id=1 type=application/pdf>
Share
I had this problem too and I finally solved it after several researches.
What I found is that the
HTTPresponse header should have the following entity-header:content-length: file sizeWithout specify this header, the web server will put the default:
content-length: chunkedI don’t know why Google Chrome has this issue, because as you said, in other browsers like IE or Firefox, they render/open correctly the PDF file.
Following is my code that I used to solve this problem. It worked in my case and now Google Chrome is displaying the PDF file of my web application!
I hope that I had helped you.
Here are some references that I found useful:
PDF Handler Problem with Chrome & Firefox
What’s the “Content-Length” field in HTTP header?