VPN
RSS Feed!Click to Subscribe!

How to embed PDF documents in WordPress without any plugins

If you wish to embed a PDF document in WordPress you could use a plugin, the most popular one is Google Doc Embedder, but, if you would like to keep things as simple as possible, you will want to avoid overloading your blog with plugins that can be discontinued or used for exploits if they have not been properly coded.

One way to embed a PDF document in a selfhosted WordPress without any plugin is using an specialist PDF storage cloud provider like Scribd or DocStoc, they both have free versions and I used DocStoc for some time until I realised that they were trying to pull my visitors to their site by including DocStoc links inside the PDF viewer I had embedded in the blog, and forcing my visitors to register with their site if they wanted to download the document I owned. Another DocStoc downside was the risk that they could go out of business or change their terms and conditions down the road.

Cutting it short I finally decided that the best way to embed PDF files in WordPress was Google Drive. If you have a Google account, signing up for Google Drive will only take seconds, you are given 15GB for free, as long as it is not copyrighted material you can upload and share files, organising them inside folders with an easy to use interface.

Google Drive PDF file sharing
Google Drive PDF file sharing

Unlike other sites, Google Drive business model is not about pulling your visitors to their site, their business is about pushing you, the publisher, to Google services. Google Drive will try to convince you to use Google own office suite, Google Docs, YouTube, HangOuts, Google + and all the other junk Google has to offer. The good part here is that they will not bother your readers, it will only be you who is messed with.

Instructions to embed documents

The default persmission for files uploaded to Google Drive is set to private, you will have to change this to “Share“, right click on the uploaded file and select “Share“, a pop up window will come up, click on a tiny button at the bottom of that window that says “Advance“, next to where it says “Private – Only you can access“, click on “Change” and select “On – Anyone with the link“, do not choose “Public on the web” because you will lose traffic, people will not have to visit your site if you make the documents accessible through other means.

Now click on “Save“, look above where it says “Link to share“, copy the link and paste in your browser in a new tab, you will see a download arrow, click NEXT to that arrow not ON the arrow, a small drop menu will open allowing you to “Report abuse” or “Embed item“, if you click on “embed item” you will be given an iframe code that works in all browsers and mobile devices.

Below there is an example of what an embeded Google Drive hosted PDF document looks like in a WordPress blog. To view it I pasted the following HTML code in text view: “<iframe src=”https://drive.google.com/file/d/0BwTZs6zSO6OOZWJnWWNLWWhkMWM/preview” width=”640″ height=”480″></iframe>

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *