How to Embed a PDF in WordPress With and Without a Plugin

How to Embed a PDF in WordPress With and Without a Plugin

This tutorial will demonstrate how to embed a PDF (with and without a plugin) in a WordPress post or page, which will make it easier for all your visitors to view the displayed content.

An example of an embedded PDF would be to display listed documents such as purchase menus, class materials, catalogs, floorplans, etc.

An embedded PDF file into your WordPress post enables your viewers to open, view, and then download and print what they are interested in. This article created by our team at wpDataTables will explain how to use two distinct WordPress plugins to embed a PDF.

  • From Media
  • Using Google Drive to embed a PDF

Both methods are fast and will help you embed a PDF file in WordPress.  We will also explain how to embed a PDF in WordPress without a plugin.

How to Embed a WordPress post using a Plugin

Embedding a PDF in a WordPress post using a plugin will give the website creator a better view of the downloads received for each offered PDF. All the downloads are visible, as well as the stop downloads of certain PDF files.

WordPress does give you certain embedding options, but it does not yet allow embedding PDF files.

Add PDF file:

  • Media option
  • Add File
  • Create Link to File

It can now be viewed either as a download or on a separate web browser.

Please see below 7 easy steps using the first plugin option for embedding a PDF in WordPress.

Embed PDF Viewer plugin

Step 1: Install/Activate the Embed PDF Viewer plugin.

Step 2: Embed a PDF document: Make a new post/edit an active one.

Step 3: While in the edit screen choose (Insert New Block Icon).

Step 4: Choose the PDF block below the (Embeds section).

Step 5: Upload a new PDF from the Media library or add from URL).

Step 6: Find and click the file you embedded; you should now see the file in your post.

After completion of the 6 steps, using the block choices on the left, you can insert CSS if necessary, as well as resizing the embedded area.

Step 7: SAVE post and preview on your live website

PDF Embedder

This is a free plugin that applies JavaScript and is offered in the WordPress Plugin directory. Follow the 2 steps below to install a free version of this plugin to embed a PDF in WordPress.

The 3 additional steps are for customization of the appearance and function of your PDF.

Step 1: Go Dashboard of your WordPress – Plugins and then Add New.

Step 2: Search for PDF Embedder (Install and activate the plugin).

Step 3 (optional): change Width and Height of PDF viewer.

Step 4 (optional) Toolbar Location/Hover: – Used to zoom the PDF viewer and change pages.

The toolbar can be on the top, bottom, or you can show it on both the top and bottom of the PDF. Choose the hover option to display a toolbar only when a visitor hovers over the document with a mouse.

Step 5 (optional) Change the setting for a specific file only: Use shortcodes. Review our example below.

 [pdf-embedder url=”http://yourwebpage.com/wp-content/uploads/2020/01/March.pdf” width=”600″ toolbar=”bottom” toolbarfixed=”off”]

Using this plugin with the Classic Editor which is also used for a video or an image.

Create a new post/revise current – click the Add Media button – Upload your PDF -Insert into post button. (A shortcode will appear in your post).

Embedding a PDF in WordPress (No Plugin needed)

Embedding a WordPress PDF is possible without a plugin. Although they’re quick, sometimes plugins are unnecessary. Instructions are provided below on how to create a PDF in WordPress without a plugin

Embedding a PDF without a plugin using the Media Section

WordPress gives you a wonderful option for problem-free inserting and embedding images and videos. As a webpage creator using the Media Library, you can also insert PDF’s to show on your post or webpage.

Using this option, visitors to your page see only the file name and link which gives them a download option.

To give your visitors this option without using a plugin please follow the steps below:

Prior to embedding a PDF file on your WordPress, it needs to be added to your page, using the Media Library provided by WordPress.

  • Find the post you want to embed with a PDF

  • Select the Add Media option
  • Go to the tab called “upload files”
  • Choose “select file” this will upload your PDF to the WordPress Media Gallery

  • Preview by returning to your post

Some people prefer to use the Gutenberg editor, which also requires you to upload your PDF file.

You can enter the file block to your webpage or post, which will reveal the name of the file and a download option for your visitors. You can also revise the name of the link and choose whether or not you will allow downloads.

You can also use the image block. To insert your PDF file using this method, first select the media library button to upload your file. If you choose to select the ‘insert into post’  option, a link will appear on your page that visitors can choose to see or download the file.

To now embed the PDF in a post, visit the Media Library, copy the URL of the file uploaded.

Copy this code below, replacing the URL part with the URL you just copied.

`<iframe src="http://docs.google.com/viewer?url=<file_url>&embedded=true" width=“800" height=“1200” frameborder="0"></iframe>`

Do not hesitate to play with the width and height to customize the size.

After inserting your URL, you should notice that it has embedded the PDF file you had chosen. This was how to embed a PDF on WordPress without a plugin, quickly and easily.

To make it more convenient for your visitors to view the PDF, format it so that the file loads in a separate browser tab.

  • Select anywhere on your linked text
  • Select the Edit button (pencil icon).
  • Select the Link options button (cog icon).

  • Mark ‘Open link in a new tab’ and click Update.
  • Update the post to complete the action.

How to embed a PDF in WordPress using Google Drive

This alternative to the above is a very simple way to embed a PDF in WordPress without a plugin. Google Drive is a useful tool for all file-based activities.

With any tool, you need a log-in. To do so please follow the simple guidelines below.

  • Create a google account or use an existing one.
  • Add your PDF file to Google Documents

  • Once uploaded simply click twice on your file and it should open.
  • Using the 3-dot drop-down menu,open your file in a separate window.

Go to the separate window, use the same menu, and click Share. You should see a pop-up called Share with others.

  • Select Get shareable link. Once you do this your PDF will be visible to all.

Once the PDF has opened, click on the three dots icon again and this time select Share.

If you want to prevent visitors from making any additional actions on your PDF, simply mark Disable options to download, print, and copy for commenters and viewers, which is available in the advanced section.

Finally, select DONE.

If you enjoyed reading this article on how to embed a pdf in WordPress, you should read these as well:

 

Up Next:

How to Create a Table in WordPress Without a Plugin

How to Create a Table in WordPress Without a Plugin