How to Embed a PDF in WordPress Using Google Docs Plugin
In a previous Hub, I showed you how easy it is to insert a PDF into WordPress as a simple text link. This is fine if you just want to create links to some PDF documents.
But what about your visitors who either don't have the Adobe Acrobat PDF reader, or don't have the proper version installed on their computer?
Forcing your website visitors to download and install upgrades to Acrobat can turn into a BIG hassle for them. Always remember the first rule of good web development: make the user's experience as easy, simple, and painless as possible.
In this Hub, I'll show you how to actually embed a PDF in WordPress, rightinto the body of your posts and pages using a Google Docs plugin. Not only does this allow your visitors to read PDFs directly on your webpage (thus eliminating one extra mouse click), it also requires no installations or upgrades of Adobe Acrobat. In fact, the visitor doesn't even have to HAVE Acrobat at all.
And here's the best part: this plugin doesn't require a Google Docs account either. Pretty cool, huh?
Installing the Google Docs Plugin
First off, let's install the plugin that will let us embed a PDF in WordPress.
Login to your WordPress website and head over to the "Plugins" tab at the left of your screen. Click "Add New" and then type "Google Docs Embedder" into the search box. Click "Search Plugins." Your screen should look similar to the one below:
Click "Details", then click the red "Install Now" button to install the plugin.
Note: Make sure the plugin is compatible with your version of WordPress. If not, you may need to upgrade your WordPress installation.
Once the plugin has finished installing, click the "Activate Plugin" link.
Google Docs Plugin Settings
Go back to "Installed Plugins" in the left-hand menu, then click the "Settings" link under Google Doc Embedder.
The settings screen allows you to configure the plugin for your website. You can choose the standard or enhanced viewer, set file types and sizes, integrate the viewer with Google Analytics, and find links to support documentation.
Check out the links below for more support info:
Upload Your PDF Document
Head over to "Media" on the left and click "Add New." Select the PDF you want to upload from your hard-drive and WordPress will automatically upload it. You should see a screen similar to the one below:
Click the "Edit" link highlighted in yellow above. Copy the full URL of the PDF on the right of the next screen:
Embed a PDF in Your WordPress Posts or Pages
Now you're ready to embed your PDF. Jump over to the "Posts" or "Pages" section and click into edit mode. Notice the new Google Docs plugin embedder button on the toolbar:
Click the toolbar icon to bring up the embedder dialogue screen. Paste the PDF's URL that you copied into the URL field. The plugin shortcode will display in the "Shortcode Preview" field:
Now click "Insert." The Google Docs plugin shortcode will appear in the body text of your page or post.
Note: Make sure you remember to "Update" the post or page to save your work.
Congrats, You're Done!
Ta daaa! That's it. You've now successfully embedded a PDF in WordPress, and your visitors can read it with no Adobe browser extensions whatsoever.
You've just made your website an easier, more user-friendly place to visit!
PS - I'd love to hear suggestions for other ways to embed a PDF in WordPress. Do you have a favorite plugin or other method you like to use? Please share it below.