Google doc no preview available error
Asked Answered
S

7

18

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");
Silva answered 1/5, 2016 at 5:18 Comment(0)
C
6

I've just tried to encode the & character to %26 and worked fine for my case.

Cismontane answered 15/2, 2019 at 20:50 Comment(0)
S
1

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

Smaltite answered 1/10, 2016 at 17:50 Comment(3)
hello itzhar, enabled google drive api and used server key in key attribute but still showing no preview available problemSilva
I added API key but still getting no preview available.Lancers
Hi, In my case enabled google drive api and used server key in key attribute Not solve the problem.Seaplane
P
0

In my case, pdf file name contained '&' character. Once I removed the ampersand char, problem solved.

Hope it helps someone.

Pachyderm answered 1/5, 2016 at 5:18 Comment(0)
D
0

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>
Decompose answered 3/2, 2020 at 14:31 Comment(0)
D
0

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.

Demetrius answered 15/4, 2021 at 9:13 Comment(0)
C
0

I used object instead of iframe, works fine in my application.

Carpio answered 24/6, 2021 at 17:21 Comment(0)
B
-2

Several things that may cause this:

  1. The browser you are using to upload these files.
  2. The size of the file you are uploading.
  3. Password/Permission of the files are set to private.

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.

Bobbitt answered 4/5, 2016 at 8:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.