I threw together this quick Google Gadget, because there was no existing gadget to embed a PDF that was saved in my Google Drive onto a Google Sites.
I was working on a project for a client who needed an easy way to do this. I thought for sure I could just use the native Google Sites functionality of “Insert > Drive > Document”. But if you try to embed a PDF using this, you get an error that says “The URL you entered is not supported.”
So, after a little bit searching, I found this post about how to embed a PDF without the left side preview pane (while useful, its annoying for embedding).
A quick glance at the Google Gadgets documentation and I whipped up this gadget that is reliably working. Feel free to use, copy, and modify to your heart’s content.
Here is the link to the gadget:
Embed a PDF Document on Google Sites from your Google Drive
And here is the URL for copy/pasting:
http://ejimford.com/gadgets/embed_pdf_google_sites_drive.xml
I’m leaving the old version above, for those that prefer it. But most people should now use the following information.
Link to the Gadget:
Embed a PDF Document (Full URL) on Google Sites from your Google Drive
And here is the URL for copy/pasting:
http://ejimford.com/gadgets/embed_pdf_google_sites_drive_url.xml
Here are the instructions for how to use the gadget:
- Go to your page on Google Sties and click the edit button.
- Click on the Insert -> More Gadgets
- On the left side of the popover, click on “Add Gadget by URL”
- Paste the URL above into the text box
- Enter the Document ID (Update: OR THE FULL URL. See above.) of your PDF into the relevant text box and make of the standard Gadget formatting changes.
- When you save the page, you’ll see the PDF embedded on the page.
Enjoy!
Just wanted to say thanks!! for creating and sharing your gadget. It worked great.
Awesome! I’m so glad it worked for you! I actually JUST finished an update that makes it so you don’t have to isolate the Document ID… You can just copy/paste the entire Google Drive PDF URL.
I’ll be updating this post sometime in the next couple of days… BUT, here’s a link to the new gadget if want to make use of it:
http://ejimford.com/gadgets/embed_pdf_google_sites_drive_url.xml
How do you know the Document ID of the PDF?
Hi, Mario! Two answers for you:
1) The document ID is in the URL of the PDF on your Google Drive. If you click the screenshot above, you’ll see the document ID highlighted. (Here’s the link to the URL)
2) I actually created a newer version of the gadget that makes it so you don’t have to isolate the Document ID…. You can just copy/paste the full URL of the PDF. I’ll update the post now to add the link to that new gadget.
Ok! The post has been updated! You can now grab the new gadget and just copy/paste the full URL.
Thanks James. It works well.
Hi,
I’m able to get the gadget but for some reason I’m getting a “Apologies. There is no preview available.”
What am I missing?
Thanks for this, Raanan. It looks like a few days ago (around November 11, 2014) Google made an unannounced update to their Document viewer so that it breaks the plugin. This has broken a TON of different tools around the web.
I won’t be able to work on a fix for this until early next week… So I’ll ask you to bear with me. I’ll update in just a moment and hopefully have a fix by next week.
Thanks for the quick response. Sure, no worries.
I really appreciate your plugin and your willingness to update it. Thanks!
This is awesome – and your quick replies equally as well. Thanks so much for helping with Google Sites and explaining what it going on with the broken plug-in.
Hi James, I wanted to let you know that Google now offers a way to embed PDFs (and many other Google docs) in much the same way your gadget worked. While editing a page, you go to the menu Insert > Drive > Document and paste the share link there. Works great. Thanks for writing the gadget before though, it was nice to use for the past few months.
Thank you Dean!! This saved me – 60 PDFs due next week! ” )
After trying soooo many options this is the only one that actually works!!!! Thanks!!!!!!!!!!
Thank you so much for sharing this! It was JUST what I was looking for!
Great gadget! I have used it twice and it works really well! My only issue is that each time I use it, I have to get the URL (saved in a doc). Is there any way to save that gadget in the list of gadgets or search for it and find it? Hoping to be able to copy and paste the link to my doc first, then quickly add. Thanks again!
Super handy. My class is making eBooks using Google presentation and now we can publish them in true eBook form. Thanks a LOT. It works like a champ!
Thanks for share good content. it worked.
Just what I needed Mr. Ford. You have saved me some grief by providing this cool pdf gadget. What I don’t understand is why google hasn’t provided this option as default, when using sites.
Much appreciated James. Worked great! I appreciate you also leaving out the usual pdf viewing tools so the pdf fills the frame.
Thanks for your contribution, it is simple, quick and nice.
How to remove extra shaded sides so that doc fits to the frame.
As an author i want a fit solution, as I myself work for my website.
if needed I can pay for your help.
Regards
ss
Hi James.
Im curious as to whether using this method means we are dependent on http://ejimford.com remaining available. When embedding the PDF, does Google save your xml code, or does Google refer to http://ejimford.com each time the PDF is accessed?
Thanks
Craig
Right you are, Craig. if you just use the gadget that is hosted on my site, it does require my site to remain active and available. however, I don’t have any plans for my website to go anywhere. And if you are are concerned about that (understandably), then you can always download the XML gadget and host it yourself somewhere by right clicking, saving the gadget to your desktop, and uploading to your own server. The gadget is free to do with whatever you like.
Hi, Sati! Sorry it took me a bit to reply to your question. I’ve been buried in other projects.
Unfortunately, I don’t think this is possible, as I haven’t found a way to pass a Zoom variable in the URL. There IS a Zoom button that appears for the user so they can zoom in themselves… But it does require them taking that action.
If anyone knows of an answer to this, I’d like it too!
Great gadget to embed a PDF from to Google Drive to Google Sites. I like that really
Easy solution after many failed attempts, thanks!
Thanks for the awesome post! Helped me a lot!
Couldn’t get any other gadgets to work, until this one. Worked first time!
THANKS
Thank you so much!
God, thank you SO MUCH FOR THIS. You are a god send.
u rock it sir . ur gadget helped me a lot and worked great .. thanks a ton..
Thank you E.James Ford for this gadget. Made life a lot easier. Even worked when Steegle’s solution didn’t!!
Just what I needed! Thanks so much for the succinct, clear directions, for your time and effort to put this together initially (as well as updates), and for your willingness to share it.
Wow, thanks so much!!!
It’s so easy to do and works well!
I just have a quick question, how would you modify the gadget so it allows 2-pages view option?
Thanks,
Vân
Unfortunately, the Google PDF Viewer doesn’t allow a 2-page view at all, so there’s no way to do this. Single page and scrolling only. 🙁