How to Add a PDF Viewer in WordPress

WordPress carries an array of awesome features along with it by default. And displaying PDF files as downloadable links is one of them. Your users are able to view the PDF only by downloading it or opening it in a new window. But, an easy way to embed a PDF on your articles or blog posts is to add a PDF Viewer in WordPress for your users. Stick with this article to know more about how you can add a PDF Viewer in WordPress easily.

By default, WordPress doesn’t embed PDF files into blog posts like audio and video embeds. You will be only provided with a downloadable link for your PDF files. This will distract your users from your original content, reducing your site’s page-views as well as user-engagement. And, that is exactly why you need to add a PDF viewer in WordPress and let your users view the PDF files without having to leave your blog.

A PDF viewer is not only handy to view the PDF file, but also to read, download, and even print the PDF file without getting distracted. So, without any further ado, let’s start our today’s tutorial.

Add a PDF Viewer in WordPress

The very first thing you need to do is to install and activate the PDF Viewer plugin from the WordPress plugin repository. The plugin allows you to embed PDF documents on your website easily.

After activating the plugin, you need to visit Settings > PDF Viewer to configure the plugin’s settings.

Settings pdf viewer

Here, on the settings page, you need to enter the document’s width and height. You can change this as per your website.

pdf viewer settings

You also have the option to disable support for older version 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.

Once you’re done with the settings, you can click the Save Changes button.

Embed the PDF file to your blog post

Now, it is time to embed the PDF file to your article/blog post. The first thing to do is to upload your PDF file like you normally would upload a media file with media uploader. You can create a new post for this or you can also embed the PDF file to an existing post. So, click on the Add Media button right above the editor on your WordPress dashboard.

Add media

Once you upload your file, you can copy the URL link of the PDF file from the media uploader.


Now, you need to paste the copied URL in between “[pdfviewer]” and “[/pdfviewer]”.

paste the shortcode

Following is an example of how the PDF would show up on your blog post.

pdf preview

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.

Well, that’s all. We hope this article helped you add a PDF viewer in WordPress. If you have anything to add, share or ask, feel free to use the comments section below.


Reference: WP Beginner

Leave a Reply

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