Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 11, 2019 04:22 pm

How to Embed and Protect PDF Files With a WordPress Plugin

PDF files are a very popular way of sharing formatted documents due to their flexibility and lightweight nature—they work on most devices and operating systems. In this post, I'll show you how to use a plugin to embed and protect PDF files in your WordPress posts and pages.

Why Use PDFs?

PDFs can be used by all kinds of business, whether you want to display a catalog for your properties or show menu items for your restaurant.

Some of the advantages of using PDF files are:

They Provide a User-Friendly Experience

When displaying information on your web pages, you should also think about how your users will consume it. While they're not as accessible as including information directly in HTML, PDF files provide a more friendly experience than other file formats. For example, not everyone will be able to open a Word document!

Information Privacy and Copyright Protection

PDF files provide the ability to deny copying or printing. This is important when you need to protect intellectual property.

Content Can't Be Easily Changed

A PDF file provides a way for users to interact with a document without changing the content. For example, people can digitally sign the document without being able to change the content.

Universal Accessibility

You can read a PDF from any device and in any language. The original version is always the same regardless of the number of times it is shared. 

When Should Your Website Use PDF Files?

Below are some instances when you should use PDF files:


  • To provide access to content that already exists in printed form.

  • To reduce the size of a document. For example, you might have a presentation that requires compression

  • For printing content such as books, manuals, catalogs or similar publications 

  • For very long text or graphic content. People prefer to download a long document than read it on the browser

  • To restrict access to content. Restricted content is better delivered via a PDF since you can employ measures such as password protection or encryption.

Getting Started

PDF Viewer for WordPress is a fully responsive plugin that allows you to embed PDF files in your WordPress posts and pages. It also allows you to enable or disable printing, downloading, zooming and social sharing.

Let's start by downloading the plugin from CodeCanyon. If you have an account already, you can purchase the plugin from the product page. If you don't have an account, you can create one from the signup page.

Once you purchase the plugin, you will get a link to the files. Alternatively, you can find them in the download section of your account with your other purchased items.

You will then need to login to your WordPress site, go to Plugins > Add New and upload the provided zip files. After uploading, click Install Now, then wait a few seconds and click Activate. You can now start using the plugin.

Features of PDF Viewer for WordPress  

PDF Viewer for WordPress is the perfect way to display your PDF files on your WordPress site. It is fully responsive and compatible with major browsers. Other features include:



  • Tracking with Google Analytics: This feature allows you to track the number of visitors who have read your PDF using Google analytics


  • Personalization of the viewer your files with your logo or branding. You can also enable and disable tools such as Find, Download, Share, Email to Friend, Page Navigation, Zoom, Print, and others.


  • Unlimited PDFs and sizes: This plugin allows you to embed an unlimited number of PDF files of different sizes.

  • Supports up to 100 languages.

  • Support for sharing PDFs on social networks

How to Embed a PDF File in a Post or Page

Once you install the PDF viewer it will appear on the left side of your admin menu as shown below.

We will start by uploading the PDF file we want to display in our page. PDF Viewer for WordPress comes with an upload feature that lets you makes the upload process easy and seamless. You can upload a PDF file from your library or from an external source and then obtain a URL to the document on your server. 

Simply follow the following steps:


  • Go to the Upload PDF File option.

  • Click on the button labeled Click here to upload the PDF file.

  • An upload dialog will pop up where you will be prompted to choose your PDF file.

  • Once you choose or upload the file, you will see a Get Link button which you will be able to click on to obtain the URL for the PDF file.

  • You can copy this link and use it to embed the PDF anywhere you like in your posts or pages.

Paste this link into a post or page to embed your PDF, which should appear as shown below once embedded.

Embedded PDF

How to Import a PDF File to a Post or Page

PDF Viewer for WordPress also provides the ability to import a PDF file from any URL. The process is similar to the upload method we looked at above.


  • Go to the Import PDF File panel.

  • Paste the link to the external PDF in the space provided.

  • Click the Import button.

  • You will then get a URL which you can use to embed your PDF anywhere you wish.

Customize Viewer Look

PDF Viewer for WordPress also lets you customize the look of your PDFs and viewer. Click on Customize Look and choose a theme or use a custom color as your theme. You can also change the text color on the toolbar as well as style icons.

PDF Viewer for WordPress Customize Look


How to Protect PDF Files

If you want to protect your files from being downloaded by everyone, there are a few measures you can use to ensure that your content is only accessible to permitted persons.

In this post, I'll show you how to use password protection to protect your content.

Password Protection for PDF Files

Password protected pages allow you to hide information from users unless they have the password. It's easy to set up password protection on posts and pages.

To protect using a password, simply follow the following steps:


  • go to the post or page that you wish to protect

  • right under the Publish button, change the visibility to Password Protected

  • enter the password and hit Publish

password protecting a post

The post or page should now prompt you for a password when you view it.

Conclusion

PDFs are very popular on modern websites.

Whether you want to display a product catalog, flyer, or invoice, PDFs are the most likely format to be used.

They provide a seamless experience for your users, by ensuring every user can read your content regardless of which device, browser or language they are using.

Also, if you want to use custom plugins but you're not comfortable tinkering with servers and prefer to have someone do it all for you, consider managed WordPress hosting. Thanks to Envato's partnership with SiteGround, you can get up to 60% off managed WordPress hosting.


Original Link: https://code.tutsplus.com/tutorials/how-to-embed-and-protect-pdf-files-in-wordpress--cms-33324

Share this article:    Share on Facebook
View Full Article

TutsPlus - Code

Tuts+ is a site aimed at web developers and designers offering tutorials and articles on technologies, skills and techniques to improve how you design and build websites.

More About this Source Visit TutsPlus - Code