Google Sites‎ > ‎How To...‎ > ‎

Embed or Link to PDF files



Link to a PDF file

To create a link to a PDF file which you have uploaded to your site, right click on the displayed link to the document and select 'copy link address'.









E.g. The address of the pdf file attached to this page is:
https://docs.google.com/viewer?a=v&pid=sites&srcid=cGpycHJvamVjdHMuY28udWt8c2l0ZXNndWlkZXxneDo2ZDgzODk4YmZhNThkYWEx

Now go to the page where you want the link, edit the page, highlight the text where you want the link, click on the LINK button in the editor, select 'Web Address' and paste in the link copied in step 1 above

e.g.

It is also possible to 'drag and drop' links from the same or another tab or window.
If you want the link to open in a new tab/window, when in the page editor click on the link, select 'change' and check the box next to 'Open this link in a new window'

Embed using Google's PDF Viewer

Alternatively, use the iframe gadget to embed the PDF viewer directly into the page using the same link as above. Unfortunately you currently have to modify the URL to add the URL parameter "embedded=true" to the end of the document URL.
so in this case 
https://docs.google.com/viewer?a=v&pid=sites&srcid=cGpycHJvamVjdHMuY28udWt8c2l0ZXNndWlkZXxneDo2ZDgzODk4YmZhNThkYWEx&embedded=true


Include gadget (iframe)



Embed Using Mori's PDF Wrapper

Or you can use Mori's PDF wrapper gadget to embed the PDF into the page as shown below.


PDF Wrapper


Embed Using Google Docs viewer

Document stored on Google Site

  • Click Edit page ► Insert ► More gadgets ► SearchGoogle Docs Viewer ► Select ► enter the URL. 
Note: If your file is hosted on a Google Site, copy and enter its Download link and make sure the host Site is public.
  • Customize the gadget Display ► OK ► Save.

Google Docs Viewer



Document stored in Google Drive

The 'official' method

The correct way to insert a preview of a PDF file hosted on Google Drive is to use the "Embed Item..." feature which is built in to the preview interface:
1. Open the document preview - either from right clicking and choosing preview or from the toolbar button
2. Go to the more actions menu and look for Embed Item... In some cases it won't appear directly, so you'll have to pop the preview to a new window using the pop-out button
3. Now you should see the Embed Item..., option. Clicking it would generate the iframe code which you'll be able to use on your site (either use it directly or copy the link from it and add an iframe gadget)
e.g.

e.g. - This is the URL of a file stored on Drive found in the embed code for that file.
https://docs.google.com/file/d/0B9K6ilf0g9SSMzRlMmI2NDAtOTYzYS00NDg5LWIzOGItZjAyZTliOGY5NmU5/preview

Inserted in an iframe, this gives:

The Quick and Dirty Method

Or if you store the document in Google Drive, right click on the file, click 'Open With', select Google Drive Viewer. Then copy and paste the URL from your browser address bar into the iframe gadget (must be shared as 'Anyone on the Internet can find and view')
I say this is the 'Quick and Dirty' method because I have been advised that this method may fail in some cases.


https://docs.google.com/file/d/0B9K6ilf0g9SSMzRlMmI2NDAtOTYzYS00NDg5LWIzOGItZjAyZTliOGY5NmU5/preview

Forcing a download of a PDF (on Drive)

You can create a URL to a file stored on Drive that will force a download by replacing FILE_ID in the string
https://drive.google.com/uc?export=download&id=FILE_ID
with the document ID from the url found as described above (in this case 0B9K6ilf0g9SSMzRlMmI2NDAtOTYzYS00NDg5LWIzOGItZjAyZTliOGY5NmU5 )

e.g. clicking on the link below should force the file to be downloaded:

(With thanks to Create Direct Links to your Files on Google Drive)


Document stored anywhere else

Provided it is available publicly on the web, you can use Google Docs viewer as described at




Subpages (1): test embed pdf
Ċ
Phil Ridout,
21 Sep 2010, 01:03
Comments