PDF is one of the most popular formats of data, and this is quite useful everywhere. PDF can be very useful to display your content on your website. For example, if you own a restaurant you can share your menus, ebooks, and other stuff with the help of pdf. Visitors can download read or print as they need.
In today’s post, I will show you how to embed pdf in WordPress. I will show you two different methods, and you can choose any of these methods.
Let’s begin, then.
- Method 1: Embed PDF in WordPress Using Google Drive
- Method 2: Embed PDF In WordPress Using A Plugin
Method 1: Embed PDF in WordPress Using Google Drive
In this method, all you have to do is keep the PDF in Google Drive and embed it in WordPress. You don’t have to use any plugins for the procedure.
Step 1: Upload a PDF File in Google Drive
First, log in to your Google Drive account. Then upload the pdf to your drive account. Just click on the new button.
Then click on the ‘File upload’.
A pop-up will open, and then you select the pdf file from your computer.
Step 2: Make The PDF Accessible
Then, you have to open the pdf file that you uploaded in Google Drive by double-clicking on it. From the top right corner of the menu bar, select the share option.
A popup will now appear with, Share with people and groups. Click on ‘Restricted’.
Then select ‘Anyone with the link’ and press the Done button.
If you don’t want your PDF to be downloaded, printed, or copied by your users, navigate to share options.
Click on the Advanced button on the top right and remove the tick on ‘Viewers and commenters can see the option to download, print, and copy.
Now click anywhere.
Step 3: Embed The PDF
Click on the three dots and click on ‘open in new window’. Again, click on the three dots and click on ‘Embed Item’.
Copy the HTML code displayed here.
Step 4: Insert Shortcode Block
Now go to your WordPress dashboard and open the page or post where you want to show the pdf. Insert a shortcode block.
Step 5: Paste The Shortcode
Now, paste the HTML code in the shortcode block.
When you publish and preview the post, you will be able to see the pdf appear on your website.
Method 2: Embed PDF In WordPress Using A Plugin
In this method a simple plugin called PDF Embedder is used.
Step 1: Install & Activate PDF Embedder
To embed PDF in WordPress using a plugin at first navigate Plugins -> Add New. Then, search for PDF Embedder. Install this plugin and activate it.
The default configuration is enough to embed a pdf, but if you want to customize settings, you can do it from Settings -> PDF Embedder.
Step 2: Add PDF Embedder Block
Now open the page post and insert a block named pdf embedder.
Step 3: Insert PDF File
Then click on ‘Click here to Open Media Library to select PDF’.
Select the pdf on your computer and hit the Select button.
Update the post, and you will be able to see the pdf in your post or page.
So, which method is you are going to choose? If you ask me, I would say to go for without plugin method as there is no need to install any extra plugins or upload media to your server. If you have any hard time embedding the pdf, ask me for help. I will be happy to do it.
If you liked the post, feel free to share it with your friends. Don’t forget to share your thoughts in the comment box below.