Pages

Saturday, September 08, 2007

Embed PDF file into post

You can see an example at Testing embedding of PDF file into post. This is a small PDF file. I will test embedding a large PDF file and/or a PDF file containing images later. Anyway, here is the method I used to embed the PDF file. This uses this very useful website Scribd.

For this task, it is best you have a browser that has tabbed browsing like FireFox with tabbed browsing. You can thus be signed into Scribd in one tab, and signed into your Blogger account in another tab, etc, all in the same window. FireFox is also fully supported by Blogger. My experience also has taught me also that having more than 1 browser is a big advantage.

First, of course, you must have the PDF file ready and stored in your computer. Go to Scribd. You can chose to upload the file immediately or register first before uploading. It is better to register first as then you can edit or delete the file, get statistics, put up your profile where you can put links back to your site or sites, thus increasing your site/sites link popularity and PageRank and possibly getting more traffic to your site/sites. Once you edit your file, your embedded file in your post will also automatically change.

To embed your PDF file, click "Browse" and locate your PDF file, Click "Upload" and then "Publish". (If you happen to be at other pages other than the homepage, click , click "Browse" and locate your file. Click "Upload" and when uploading is finished, type in some suitable tags, a description, then click "Publish". The next page will tell you your file has been converted and give a link "View here!" . Click on the link "View here!". The next page will display your converted file and on the left sidebar, will be a box with the script for embedding into your post: . (Update: To get the script to embed the document, you will have to click the button SHARE as in the screen shot below:

)

Click on the inside of the box and the whole script will be highlighted. If it is not, press ctrl+A keys simultaneously (or right-click on your mouse and select "select all"). Press ctrl+C (or right-click and chose "copy") to copy script into clipboard. The original script generated by Scribd is shown in the scroll box below"

Change to the tab where you are logged into Blogger with the post editor window opened, paste the script into the post editor window. Now, you may have to tweak the script so that the embedded PDF file fits nicely into the post. For this, you will have to know the width of your main column. Refer to How to find the widths of the Header, main column (posts) and sidebar/sidebars (click BACK button to get back to this page). Below is the original script generated by Scribd. The most important variable you have to note is width="500" (highlighted in red). The width of the main column (posts) of Testing embedding of PDF file into post is only 400 pixels, so I have to change the width in the script to 400 or less. The height is less important, and you can set it to any number you wish so that the height of the embedded file is as what you want it to be.

However, if you want to keep the original aspect ratio of the embedded PDF file generated by Scribd, like what I did for Testing embedding of PDF file into post, you will have to use a photo editor. The process is explained at Resize images with Irfanview. What I did was create an empty image and typed in 450 for the width and 500 for the height, then click OK. An empty image was created. I wanted the width to be slightly less than the width of the main column (posts). I ticked the box next to "Preserve aspect ratio" and typed in 399 for the width. The height automatically changed to 433, so I edited the script to get width="399" and height="433". Note that this has to be done in two places in the script (highlighted with red ellipse). The new script is shown in the scroll box below:

There is another method to embed PDF file which will be described in the next post.

Update 9 September 2007: Missed something. Dnis aRCol said he embedded a 774 page PDF file at 2007 Nursing Board Exam Result. I tried to download the PDF file to check its size, but the Dnis has disallowed downloading the file in PDF format.

Thanks for the link. LaTex looks like a pretty interesting resource. I am a retired scientist and can see the usefullness of LaTex for the academic professions. But it looks like it may take some time to learn. I can't afford the time at the moment. So I did a test using one of the documents in their site which I assume is done with LaTex. It has been successfully embedded at Testing embedding LaTex document.

It is Mike Unwalla. His email is available so I will be drawing his attention to the above post and see if he has any objections. Hope I can find the time to learn to use LaTex to produce a document with scientific notations and equations.

Hello Mr. Chen, thank you for this post, this information is very useful to me. You mentioned that you have another way to embed pdf files into a post? Is there a way to just display a small thumbmark of the pdf file with corresponding name and/or title on the post and when it is clicked the reader will be taken to the actual file? I hope this is possible. If there is anyone who can find out if it can be done it's you! Thank you again, YOU are the Superman of the blogging world!

I am not very sure what you mean by thumbmark, and hope you can describe it more clearly. But I think I have a fuzzy idea of what you want, and will try to demonstrate when I have cleared my backlog of comments, emails to respond to plus tasks that has datelines. In the meantime, do give me more info on what you want. And copy-paste the URL of this post into Notepad file, save it into a "to do" folder anc check back later to see if there is further developments.

Thank you for your prompt reply. I try to check your site as often as I can because I like tweaking my blog and your tricks and tips are easy for a lay person like me to follow and I've done some neat things with them. With regards to my pdf problem, in the meantime I am just going to save a small *thumbnail* (sorry for the mistake! I am so stupid) of the pic of my document, save it on the sidebar of my blog as a clickable pic that will lead to the Scribd site. Thanks so much again for taking the time to reply so quickly... and in anwer to your question, yes, Kopi Tiam is alive and well in the Philippines :)

Note from blog author: Please do not leave long unbroken line like an inactive (unclickable) long URL like the post above. The above comment had to be edited for this very reason - it has a long unbroken URL which extend into the sidebar and can cause problem-----------------------Edited comment:

which means it was published just a few days ago. I also see at the bottom of the post:

"Please give credit to Author if you find this info useful."

I see that you have given a link blog which is to the home (main or index) page of this blog which may help a little, but is highly deficiently in your choice of anchor text. See Importance of anchor text in hyperlinks. Further, I don't see it as an acknowledgement of the source as my name or title of my blog was not mentioned nor anything mentioned that the source of your post was from this blog.

gud day! i try to follow the instruction posted on how to embed a pdf files but it doesn't work... in your codes they are just few but when i have my codes for my file they are too many...can you help me? thnks... you can e-mail me here: markyheras@yahoo.com.ph/markyheras@gmail.comGod bless...

just wanted to say that as an amateur blogger, i find your site very useful. quick question re pdf embed: the scribd link was awesome, but i cant seem to figure out how to make the scribd box smaller. any suggestions?

Mr. Chen greetings from india. I am amateur blogger (learnsharegrow.blogspot.com) and recently started blogging. I posted one 'Post' on my blog and wanted to attach an 'MS Excel" .xls file. Unfortunately I am not able to find out how to do. Please help and tell me how I can upload MS Excel file with my post or separately in my blog. Thanks, vineet_jain@pgp2005.isb.edu

Great guide!If you want to take a look, icomentario.blogspot.com. I think that you won't be able to understand the content of the pdf (it is in spanish) but you will see that I could perfectly did it with your guide.Thanks.

I am technologically challenged. I am trying to post a PDF to www.blueheronblast.com. I joined scripd and as you can see it posts but with a lot of attendant garbage around it from scripd. Is there a way for the doc to fly free? Thanks ever so much.

I was looking for the exact same thing - add/embed a PDF into my my blog. And your post provided very clear, pin-point help. Scribd's iPaper provides a really neat way to convert and share documents online.

just discovered your blog and post today through a Google search...your instructions are excellent...I just successfully followed them...after registration at Scribd...uploading a pdf and showing it on my own blog took about 5 minutes and this was the first time ever. How easy this was and what a great tool! THANKS for taking the time to give these instructions. I've just emailed about 100 friends with a link to this post in case any of them (some also have blogs...many use FB) would like to know how to do this. THANKS!

Hi, I am a math teacher new to blogging, trying to share a powerpoint on my blog. I created a scribd account and uploaded my ppt, but when I cut and paste it is a mess. What looks like a bunch of code....can you help?

I have found that I could not upload my PDF files that I uploaded to Google docs onto my blogger blogs. But I have posted my blogs onto my sites on blogger by clicking the post to blog tag.And my Google docs are published on my blogs. Some of my docs published have photos added by me in addition to my work. And I can edit the text as well.Also Google indexes my Google docs when I publish to blogger,but the original web link where the document was publshed is not indexed. So publishing on blogger gets them noticed. Andrea.

It is Scribd and not squid. For alternatives, you may consider Google Docs word processing, spreadsheet or presentation. More info at Wikipedia. However, Scribd would be most useful for those who already have MS Word, Excel or Powerpoint document ready for embedding.

Peter: I really appreciate your insights: I have been posting a book chapter by chapter but would like to collect the first part in a pdf or some other convenient mode so that it could all be read at once instead of having to jump to a new post constantly. How could I best do that? Q

I never thought it was possible, but upon reading this post I was proven wrong! This surely is the best and probably the easiest way of embedding pdf file into posts, which proves to have its positive effects depending on the content you are providing.

Unfortunately that is the reality of things, nothing can continue forever for free, otherwise where do they get the money to survive? They are not Blogger with a Sugar Daddy like cashrich Google. Anyway best you contact Scribd support.

Any ideas on how to allow blog readers to print the pdf without logging in to Scribd? I got the pdf's to show up fine, but then I had to add instructions to the post to say "To print, first download the document ...." But clicking on the download button takes the user to Scribd's login page. This will not serve my purposes at all.