Adding a PDF viewer to WordPress for enhanced functionality

pdf view

The PDF format is ideal for maintaining consistent layouts across devices. By embedding PDFs in WordPress, visitors can view files without leaving the site, increasing pageviews. WordPress typically only offers PDFs as downloadable links, but adding a PDF viewer allows for easier viewing without leaving the page. The PDF Embedder plugin is recommended for this purpose, providing customizable settings for the viewer. In the Classic Editor, simply drag and drop a PDF into a post or page to embed it. This method adds a shortcode that displays the PDF when the post is previewed or published. This feature enhances user experience and keeps visitors engaged on the site.

The PDF format is great to use when you want your files to always have the same layout, no matter what device they are viewed on. By embedding PDFs in WordPress, you can share your files while keeping visitors on your site.

In this article, we will show you how to add a PDF viewer in WordPress.

Why Do You Need to Add a PDF Viewer in WordPress?

Normally, WordPress does not embed PDF files into blog posts like it does with audio, video, tweets, and other media formats. It only adds the file as a downloadable link.

This means your visitors will have to leave your post to view the PDF. They will likely not return to your site, which reduces pageviews on your site.

See also  Basic hooks in Flatsome - Part 1

One way to solve this problem is to offer PDFs as content upgrades. You can ask users to sign up for your website email to receive the bonus.

However, if you just want users to view PDF files without leaving the page, then you will need to add a PDF viewer.

How to Install and Setup PDF Embedder

I recommend you to use plugin PDF Embedder. It uses JavaScript to embed the file with a fully functional toolbar that allows users to zoom and navigate the PDF file.

First, you need to install and activate the PDF Embedder plugin.

Once activated, you can visit Settings » PDF Embedder to configure plugin settings. The default settings are suitable for most websites, so this step is optional.

Settings allow you to control the height and width of the PDF viewer. You can change this if you feel the PDF viewer is not suitable.

You can also choose to display the toolbar at the top or bottom of the viewer and hide it until the user hovers over the document.

Once you are done customizing your settings, don’t forget to click the ‘Save Changes’ button to store them.

Now we are ready to embed a PDF file into a WordPress post or page. Here we will show you how to do it using the Classic Editor.

How to add PDF viewer in Classic Editor

Embedding PDFs in the Classic Editor is just as easy. Start by adding a new post or opening the one you’re working on.

Next, you should place your cursor where you want the PDF to appear and you should drag the PDF onto the page. When you see the “Drop files to upload” message, you can release your mouse button.

See also  Installing SSL security certificate for your website.

The PDF will be automatically uploaded to your media library and selected. All you need to do now is click the ‘Insert into post’ button.

PDF Embedder will add a shortcode to your post or page. It will look like [pdf-embedder url = “PDFURL”]. This will display the PDF file when you preview or publish the file.

To view the PDF, simply save your post and preview it on your live site. Here’s how it looks on my demo site.

Epilogue

With the above instructions, I hope to bring convenience to your users.

If you find it interesting, you can follow the basic WordPress section to learn more new knowledge.

Follow fanpage to receive the latest articles: Hocwordpress Group.

Rate this post

Related posts