Tuesday, December 27, 2011

How to embed PDF in blogger?

This should works for PDF and any document that uploaded or created in Google docs.
I posted this so that I can find this blogging tips easily next time when I want to embed another PDF or Google docs in my blog.

1. Make sure you are using "Edit HTML" mode when adding the code below (Otherwise, it will try to load the document in "Compose" mode as soon as you paste the code).
<iframe frameborder="0" height="75%" width="50%"
src="http://docs.google.com/gview?
a=v&amp;pid=explorer&amp;chrome=false&amp;api=true&amp;embedded=true&amp;srcid=
0B6E4pzOCFjPAMjA1MTFiNzQtOTZiYi00NTM4LWEzZDItMzcxOGI1NTRlNTIz"
width="100%"></iframe>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

2. Open the PDF or google documents at docs.google.com, copy the documents ID from the URL and replace with the ID in the code above (bold and purple font). It should be a bunch of numbers and letters starting at srcid= and ending with =en. Or between srcid= and double quote.

3. Adjust the height and width of the PDF or document you want to display in your blog. It can be in percentage or pixel. The example showed here is in percentage.
height="75%" width="50%"

4. Hit "PREVIEW" button to preview it to make sure it is in the size that you want. If not, go back to step 3 to edit the height and width.

I used this method to embed a PDF which is a ebook of this blog in previous post:
Publish your blog into PDF and Kindle and ePub


Hope you will enjoy this post, subscribe to my RSS or mailing list or follow me on blogger or twitter. :)
source of this tips: http://www.google.ca/support/forum/p/Google+Docs/thread?tid=2e81a3ec8fc33480&hl=en

4 comments:

iMSM said...

Here's a way to embed PDF into Blog post.

http://www.littletechiethings.com/2012/02/embed-pdf-file-inside-blogger-post.html

ahsiang said...

@KC, nice post you have there.

Suz said...

absolutely fantastic worked so easy many thanks

ahsiang said...

@San Lesslie, you are welcome. :)

Related Posts Plugin for WordPress, Blogger...
 
Copyright © 2015 Outdated Penang Uncle
..........