PDF document fails to load in embedded Google document viewer

I’m trying to embed a PDF file using Google’s document viewer but running into issues. Here’s the code I’m using:

<iframe width="800" height="600" frameborder="0" src="https://docs.google.com/viewer?url=https://example.com/files/documents/manual.pdf&embedded=true"></iframe>

The problem is that instead of showing the PDF content, I keep seeing an error message saying the document cannot be retrieved or I don’t have viewing permissions. I thought maybe my internet provider was blocking Google Docs, but when I test other websites that use the same viewer, those work just fine. Has anyone else experienced this problem? What could be causing this specific PDF to not load while others work normally?

totally got the same issue once! its usually a permissions thing. try changing the sharing settings on your PDF and make sure its public or anyone with the link can view it. that fixed it for me!

Had this exact problem with several PDFs on my company site. The issue was CORS headers - my server wasn’t configured properly. Google’s document viewer can’t fetch your file if the server blocks cross-origin requests, so you get that permissions error. Check with your hosting provider or server admin about CORS configuration for PDFs. Some CDNs also restrict embedding through third-party viewers. Quick workaround: test by hosting the PDF on Google Drive first and using that URL. If it works, you’ll know it’s a server issue.

Check the PDF file itself too. I’ve had certain PDFs fail while others worked fine in Google’s viewer. Some of my files had password protection or DRM that wasn’t obvious - even though I could open them normally, Google’s viewer rejected them because of embedded security settings. File size matters too - anything over 25MB usually times out or won’t load consistently. Open your PDF in another app and see if there are security warnings or restrictions. Sometimes just re-saving the PDF without those security features fixes it completely.