WordPress provides an array of awesome features by default for its users. And displaying PDF files as downloadable links is one of them. However, your users are able to view the PDF file only by downloading it or opening it in a new window. One of the easiest ways to embed and view a PDF on your articles or blog posts is by adding a PDF Viewer in WordPress for your users. Stick with this article to know more on adding a PDF Viewer in WordPress efficiently.
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 the user engagement. And, that is exactly why you need to be concerned about adding a PDF viewer in WordPress and letting your users view the PDF files effortlessly, 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.
Adding a PDF Viewer in WordPress Using a Plugin
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 further configure the plugin’s settings.
Here, on the settings page, you need to enter the document’s width and height. You can change this as per your website.
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.
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]”.
Following is an example of how the PDF would show up in your blog post.
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 the PDF files.
Well, that’s all. We hope this article helped you in adding 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