Reputation: 3027
I used the google doc to display the pdf file in web broswer. It was working fine before. Now it gives no preview available. Most of the time it gives the blank screen with no preview available but sometime it opens the pdf. However i noticed that if the size of the pdf is small, it works fine but if the size is a bit larger with 10-100 or more pages, the no preview is shown.
link:
https://docs.google.com/gview?embedded=true&url=http://trafficpolice.gov.np/traffic/uploadfiles/56a0e8156d4ea.pdf
code:
WebBrowser view = new WebBrowser();
view.setURL("https://docs.google.com/gview?embedded=true&url=http://trafficpolice.gov.np/traffic/uploadfiles/56a0e8156d4ea.pdf");
Upvotes: 18
Views: 31964
Reputation: 11
For those who are trying localhost. You CANNOT use localhost to view previews. You can tunnel port 80 with ngrok and then it will work.
Upvotes: 0
Reputation: 61
I added this code to my web.config. Works every time after these changes.
<basicHttpBinding>
<binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
Upvotes: 0
Reputation: 61
I've just tried to encode the &
character to %26
and worked fine for my case.
Upvotes: 6
Reputation: 116
In my case, pdf file name contained '&' character. Once I removed the ampersand char, problem solved.
Hope it helps someone.
Upvotes: 0
Reputation: 13031
I had the same problem, in my case, I enabled google drive api and add key attribute to my iframe:
WebBrowser view = new WebBrowser();
view.setURL("https://docs.google.com/gview?key=YOUR_API_KEY&embedded=true&url=http://trafficpolice.gov.np/traffic/uploadfiles/56a0e8156d4ea.pdf");
problem resolved after 1 day
Upvotes: 1
Reputation: 6791
Several things that may cause this:
Quick Fix:
It has been noticed that most of the users who encounter this have been using Firefox (3.6.6 in particular). Try uploading your files using IE8 and clear your cache.
This issue has been further discussed here.
Upvotes: -2