0

I embed the document using it's direct link. Here is the code:

<iframe src="http://docs.google.com/viewer?url=mco2008030016.pdf&embedded=true" style="width: 718px; height: 700px;" frameborder="0"></iframe>

However I get the following error:

Sorry,we are unable to retrieve the document for viewing or you dont have permission to view the document.

How can I embed this file properly?

Jimshad Abdulla
  • 167
  • 1
  • 8
  • You need to add more detail as to what you are trying to achieve. Are you trying to embed a Google document? Please post sample code – jb11 Dec 16 '11 at 07:06

2 Answers2

0

You can create a document and make it publicly accessible. Follow this link to make it public http://www.wikihow.com/Make-a-Google-Doc-Public Then copy the link which gets created for public use and embed it in a iFrame(for web). It worked for me.

Sameeksha Kumari
  • 918
  • 1
  • 13
  • 19
-1

The most probable reason for this is because when you try to view the PDF yourself, you have authorized access to your Google Docs. When you embed the file in an iFrame, it thinks you're not logged in yet (technically, this is caused by sessions).

Possible solutions are:

  1. Export the PDF and upload it to a local directory in your web server.
  2. Check the permissions of the PDF file and change it to "Public on the web".