WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
  • Deals
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» WordPress Plugins» How to Add a PDF Viewer in WordPress

How to Add a PDF Viewer in WordPress

Last updated on January 9th, 2016 by Editorial Staff
260 Shares
Share
Tweet
Share
Special WordPress Hosting offer for WPBeginner Readers
How to Add a PDF Viewer in WordPress

Do you want to add a PDF viewer in WordPress? By default, WordPress displays PDF files as links. Users can view the PDF by downloading it or opening it a new window. But what if you wanted to embed a PDF in your blog post? In this article, we will show you how to add a PDF viewer in WordPress.

PDF Viewer for WordPress

Why and When You Need a PDF Viewer in WordPress?

WordPress does not embed PDF files into blog posts like it does with audio and video embeds. It just adds the file as a downloadable link.

This means that users will have to go away from your page to view the PDF file. Many of these users don’t come back to your site, and this reduces your site’s pageviews as well as user-engagement.

One way to deal with is to offer PDF files as content upgrades. This way, you can ask users to join your email list to get the bonus content.

However if you just want users to view PDF files without leaving your website, then you will need to add a PDF viewer in your WordPress site.

A PDF Viewer will embed the PDF right into your WordPress posts and pages. Users will be able to view, read, download, and even print the PDF file without leaving your site.

Installing and Setting up a PDF Viewer in WordPress

First thing you need to do is install and activate the PDF Viewer plugin. Upon activation, you need to visit Settings » PDF Viewer to configure the plugin settings.

Settings page for PDF Viewer plugin

PDF Viewer plugin allows you to control the height and width of the PDF viewer. You can change this if you feel that PDF viewer container is too wide or narrow on your site.

You can also disable support for older versions of Internet Explorer. By default, the plugin will not show the PDF viewer to users with Internet Explorer 9 or below. Instead, those users will see a download link. You can modify the message users with old browsers will see.

Don’t forget to click on the save changes button to store your settings.

Embedding PDF Files with PDF Viewer in WordPress

Adding PDF files in your blog post is quite simple. First you need to upload a PDF file using the media uploader. You can do this by creating a new post or edit an existing one, and then click on the ‘Add Media’ button above the post editor.

Use media uploader while writing posts to upload your PDF files

After uploading your file, you can copy its URL directly from the media uploader.

Copy the URL of PDF File

Next, you need to add this URL wrapped between [pdfviewer] [/pdfviewer] shortcode. Like this:

[pdfviewer]http://www.example.com/wp-content/uploads/2016/01/myebook.pdf[/pdfviewer]

This is how the PDF Viewer will display your file in your WordPress post.

PDF Viewer demo

You can add height and width parameters to the shortcode as well. This is particularly helpful if you want to override the default height and width defined in plugin settings.

The PDF Viewer uses Mozilla’s PDF.js script to display PDF files. It renders PDF files beautifully with the standard set of tools to scroll, search, jump between pages, print, and download PDF files.

We hope this article helped you add a PDF Viewer in WordPress. You may also want to take a look at our guide on how to restrict content to registered users in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

260 Shares
Share
Tweet
Share
Popular on WPBeginner Right Now!
  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Step by Step Guide: How to Start a Podcast with WordPress

    How to Start Your Own Podcast (Step by Step)

  • Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

The Ultimate WordPress Toolkit

23 Comments

Leave a Reply
  1. Ian says:
    Nov 30, 2017 at 2:49 pm

    I see that PDF Viewer has not been updated in 3 years, and has not been tested with my current version of WordPress (v4.9.1). Is this still the suggested plugin to use? It’s looking like no one is maintaining it, perhaps?

    Reply
    • WPBeginner Support says:
      Nov 30, 2017 at 5:34 pm

      Hi Ian,

      You are right. You should check out these PDF plugins for WordPress.

      Reply
  2. Manoj jidugu says:
    Oct 5, 2017 at 7:40 am

    if am clicking print for my word press web page i am getting the page which is not properly aligned.
    I am getting all the urls and content combined

    Reply
  3. Marek says:
    Jun 20, 2017 at 4:46 am

    On the plugin page it says:
    “This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.”

    Maybe that’s why it does not work for some.

    Reply
  4. Kallol Das says:
    Feb 27, 2017 at 1:25 am

    In my site pdfviewer does not work. In fact I cannot embed any pdf file on my blog post.

    Reply
  5. rajesh says:
    Oct 16, 2016 at 1:12 pm

    hi i want to publish a book in my wordpress site and people only read the book so can u refer me any easy pdf reader plugin

    Reply
  6. Omar says:
    Jul 22, 2016 at 6:53 pm

    This is not working for me on the last version of WP. Someone know a workaround? Or another option that works?

    Reply
  7. fred says:
    Jun 27, 2016 at 12:34 pm

    Hi guys,

    the problem with PDF plugins like this ones, is that you cannot remove sibar(s) when generating your PDF, an that changes style a lot !

    If ever I find one that has this so useful feature, I come back here to tell you ! Or maybe someone found one somewhere ?

    Reply
  8. ibrar says:
    Jun 5, 2016 at 1:24 pm

    NIce information

    Reply
  9. Nate Richie says:
    Feb 24, 2016 at 7:11 am

    You should try ‘Embed Any Document’. It’s a much better alternative.

    Reply
    • AllyG says:
      Oct 23, 2016 at 3:28 pm

      Thanks for the recommendation. It works great!!

      Reply
  10. Piet Marisael says:
    Feb 17, 2016 at 4:27 am

    Is it possible to set the viewer by opening a file to 110% view automaticly and how i gonna do that?

    It’s a perfect plugin used by WordPress 4.4.2 and twenty-eleven theme

    Reply
  11. Darron says:
    Feb 1, 2016 at 3:11 am

    Hi Syed,
    Many thanks for the ‘heads up’ on this issue.

    I’ve been using the following free version of this plugin for the last two years, though have just upgraded to the premium due to the high number of fPDF’s held on my clients site:

    So far I’ve had no issues at all with the premium version, I’m also able to ‘unbrand’ the document, plus track the number of download/views.

    Reply
  12. Rita says:
    Jan 13, 2016 at 1:21 am

    I read the info that you indicated. Looks like the pdf viewer is not available for wordpress.com. Too bad. I understand the issue that readers who click on my url for a pdf will go to a separate page, and may not return to my blog. That is a problem. I didn’t know that I would have this a need to display pdfs when I started with wordpress.com, or I may have made a different choice.

    Reply
    • Rita says:
      Jan 13, 2016 at 12:00 pm

      Am I correct that WordPress.org is the required application for the embedding plugin? If so, I suggest that information be clearly stated as a requirement. All references that I saw are to the generic WordPress, so it’s not possible (Did I miss it?) to determine whether there is a specific application requirement. It would help us newbies to avoid mistakes, and direct us to potentially making different decisions.
      Thanks.

      Reply
  13. Dan says:
    Jan 12, 2016 at 12:29 pm

    I really appreciate your posts that identify a DIY (do it yourself) issue in wordpress, and then provide some alternate solutions, usually involving plug ins.

    “But”, am wondering if you take the time to read some of the reviews posted by users on the plugin page in wordpress.org directory, and also the LAST UPDATED info.

    For example, this PDF VIEWER plugin was last updated “8 months” ago, and is compatible up to WP 4.2.6

    Also, per one reviewer….

    “November 4, 2015 for WP 4.3.1
    This plugin was precisely what I needed. Thanks!

    ******Only concerns are:
    (1) This plugin leverages Mozilla PDF.JS framework. As of 2015-NOV, this plugin is significantly behind the present version of that framework:

    Plugin Settings page states:
    PDF.js Version Date
    Stable 1.1.1 18 Mar 2015
    Beta 1.1.114 7 May 2015
    PDF.JS page states as of 2015-NOV:
    Stable 1.1.366
    Beta 1.1.469

    SUMMARY > Don’t you think it’s good practice to use plugins with good ratings, but that are also consistently updated and highly rated ? If you do, please include some info in your posts that acknowledge a suggested plugin hasn’t been updated in a while, but appears to be the best solution among the ones currently available.

    Reply
    • WPBeginner Support says:
      Jan 12, 2016 at 2:20 pm

      PDF Viewer allows you to use the beta version of PDF.js from the settings page. You may also want to see our guide on Should You Install Plugins Not Tested With Your WordPress Version?

      Reply
  14. Rita says:
    Jan 12, 2016 at 10:30 am

    I use WordPress.com, not .org. Can I embed pdfs and other documents using a plug-in? I have found varying references, and want to be certain, before experimenting and possibly damaging m existing blog.

    WordPress.com edit page does have a location labeled plugins. That also leads me to believe that I can use them, yet, references say “no”. I’ll appreciate an explanation.

    Thanks

    Reply
    • WPBeginner Support says:
      Jan 12, 2016 at 2:25 pm

      Please see our guide on the difference between self hosted WordPress.org vs free WordPress.com blog.

      Reply
  15. Md Riyaz Alam says:
    Jan 12, 2016 at 1:00 am

    Hey Syed,
    I think this is the first of its kind pots on wordpress. I did not see a post on PDF for WordPpress, but many of SEO and bloggers are looking for this pluging. So thanks to introduce this to the WP industry. This could be very helpful for tutorials as well.

    Reply
  16. Rita says:
    Jan 12, 2016 at 12:51 am

    I am using WordPress.com (not .org). I want viewers to see my pdf documents on the same page as the rest of my blog post. Can I install the pdf viewer that is described here, in my WordPress.com blog?

    Reply
  17. Prince says:
    Jan 11, 2016 at 11:01 am

    Thanks for this article. For SEO purpose, is it better to add the pdf content in text and add a button to download the link, or to display the pdf only using this viewer plugin ?

    Reply
    • WPBeginner Support says:
      Jan 11, 2016 at 11:42 am

      Like we said, a download link forces users to view the PDF separately. This decreases the time they spend on your page and their chances of coming back to resume browsing your website. You will get the same SEO benefit as adding a download link. Since it is written in JavaScript and compatible with HTML5 search engines can still index your PDF contents if the PDF file has text in it and not just images.

      Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 600,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WPForms Logo
WPForms
Drag & Drop WordPress Form Builder Plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 25 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2018 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2018)
    • Which is the Best WordPress Slider? Performance + Quality Compared
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • 5 Best VPN Services for WordPress Users (Compared)
    • HostGator Review - An Honest Look at Speed & Uptime (2018)
    • SiteGround Reviews from 1032 Users & Our Experts (2018)
    • Bluehost Review from Real Users + Performance Stats (2018)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Start a Podcast with WordPress (Step by Step)
    • How to Choose the Best Domain Name (8 Tips and Tools)
    • How to Setup a Professional Email Address with Google Apps and Gmail
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2018 – Step by Step Guide
Deals & Coupons (view all)
Themify
Themify Coupon
Get 20% off on Themify theme's beautiful WordPress themes. Responsive designs with tons of options.
iPage Coupon
Get over 83% off on iPage web hosting and a free domain name.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • List25
  • Awesome Motive
  •  

Copyright © 2009 - 2018 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

WordPress hosting by HostGator | WordPress CDN by MaxCDN | WordPress Security by Sucuri.