How to Add a PDF Viewer in WordPress

Do you want to include a PDF viewer in your WordPress installation?

When you want your files to have the same layout no matter what device they’re viewed on, PDF is a good format to use. You can share your files while keeping visitors on your website by embedding PDF files in WordPress.

We’ll show you how to add a PDF viewer to WordPress in this article.

In WordPress, how do I add a PDF viewer?

What Is the Purpose of a PDF Viewer in WordPress?

Unlike audio, video, tweets, and other media formats, WordPress does not embed PDF files into blog posts by default. It simply adds a download link to the file.

PDFs are added as download links by default.

This means that in order to view the PDF file, your visitors will have to leave your post. Many of these users will not return to your site, resulting in fewer page views and lower user engagement.

Offering PDF files as content upgrades is one way to deal with this. You can then ask users to join your email list in order to receive the bonus content.

You’ll need to add a PDF viewer to your WordPress site if you just want users to view PDF files without leaving your site.

Installing and Configuring PDF Embedder

We’ll be using PDF Embedder, which is one of the best WordPress PDF plugins.

It embeds files with a fully functional toolbar that allows users to zoom in and navigate the PDF file using JavaScript. It’s also fully responsive, meaning that the embedded PDF can be viewed on any screen size.

The PDF Embedder plugin must first be installed and activated. See our step-by-step guide on how to install a WordPress plugin for more information.

You can configure the plugin settings by going to Settings » PDF Embedder after it has been activated. This step is optional because the default settings are suitable for most websites.

Settings for the PDF Embedder

The PDF viewer’s height and width can be adjusted in the settings. If you think the PDF viewer is too wide or narrow, you can adjust it.

You can also decide whether the toolbar should appear at the top or bottom of the viewer and whether it should remain hidden until the user moves their mouse over the document.

A download button, continuous page scrolling, clickable links, and file download tracking are all available in the premium version. It also includes a variety of mobile and security options.

When you’ve finished customizing your settings, remember to save them by clicking the ‘Save Changes’ button.

How to Use the Block Editor to Create a PDF Viewer

It’s simple to include PDF files in your WordPress posts and pages. We’ll begin by creating a new post or editing one that already exists.

To begin, place your cursor where you want the PDF document to be embedded. Then, at the top left of the WordPress edit screen, click the Add Block + button to add a new block.

After that, go to the Text section and click the ‘PDF Embedder’ button.

Add a PDF Embedder Block to your page.

After that, you’ll need to either upload a new PDF file or choose one from your media library to add to your post. Click the link that says ‘Click here to Open Media Library to select PDF’ to do so.

Select a PDF File by clicking on it.

You’ll be taken to the media library for WordPress. If you haven’t already done so, go ahead and do so now. Simply drag the file into the library, then let go of the mouse button when you see the ‘Drop files to upload’ message.

Drag and Drop Files to Upload

The PDF will be uploaded and selected automatically. It’s as simple as clicking the ‘Select’ button.

Choose or upload your media

Your document will now include the PDF. While editing the post, you won’t see a preview of the PDF. Instead, the URL of the file is contained in the block.

The PDF file has been embedded.

You’ll need to save your post and preview it on your live website in order to see the PDF. On our demo website, this is how it looks.

See the the PDF Viewer in action.

In the Classic Editor, how do I add a PDF viewer?

It’s just as simple to embed a PDF in the classic editor. Begin by creating a new post or editing an existing one.

After that, place the cursor where you want the PDF to be displayed, and then drag the PDF onto the page. You can let go of your mouse button when you see the ‘Drop files to upload’ message.

Place the PDF on the Page by dragging it there.

The PDF will be uploaded and selected automatically in your media library. You only need to click the ‘Insert into post button now.

Place the PDF on the Page.

A shortcode will be added to your post or page by PDF Embedder. [pdf-embedder url=”PDFURL”] will be the result. When you preview or publish the file, the PDF will appear.

Shortcode for PDF Embedder

Simply save your post and preview it on your live website to see the PDF. This is how it looked on our test website.

We hope you found this article useful in setting up a PDF viewer in WordPress.