Don’t Download My PDF!

It is fairly common to find PDF documents on the Web. Most of the time PDF documents are displayed in the reader’s browser using the browser’s built-in PDF viewer. As such, the publisher of the PDF documents don’t have any control over what can be done with the PDF document by the reader. The major browser-native PDF viewers allow users to save copies of any PDF that they view. This presents a problem for people who want their readers to view PDF content but don’t want copies of the PDF floating around because the document is copyrighted or some other similar reasons. This article addresses this issue by presenting a method for sharing PDF documents without allowing readers to download copies. The method we present is fairly simple and should be easy for anyone to follow. We will be presenting an alternative, more technical method in the near future.

After searching for potential options, a few solutions to this problem surfaced. Mainly these solutions involve converting the PDF to a different format. For example, in a stack overflow thread, guildsbounty describes one approach:

What you can do is convert the pdf to an image/flash/whatever and wrap it in an iFrame. Then, you create another image with 100% transparency and lay it over top of the iFrame (not in it) and set it to have a higher Z-value than the iFrame.

What this will do is that if they right click on the 'image' to save it, they will be saving the transparent image instead. And since the image 'overrides' the iFrame, any attempt to use print screen should be shielded by the image, and they should only be able to snapshot the image that doesn't actually exist.

Didn’t I say that we would be presenting an easy solution in this article? Fortunately Google has already implemented the complexities of the solution described above. If you want to share a PDF document that your audience can read but not save then you can use Google Docs to embed Google’s PDF viewer in your web page.

Follow the following steps to embed a non-downloadable PDF on your web page:

  1. Upload your PDF to Google Drive
  2. From Google Drive, open your PDF in Google Docs
  3. Click the “Share” button
  4. Click “Advanced”
  5. Under “Who has access,” select “Change”
  6. Select “On – Public on the web”
  7. Make sure “Access” shows “Anyone (no sign-in required) can view”
  8. Click “Save”
  9. Check “Disable options to download, print, and copy for commenters and viewers”
  10. Click “Done”
  11. Open the “File” menu
  12. Select “Publish to the web…”
  13. Select the “Embed” tab
  14. Click “Publish”
  15. Copy the code that appears
  16. Paste the code into your web page code where you want the PDF to be displayed
    1. If you are using a CMS such as Kentico then you will want to use a WYSIWYG
      1. Switch the WYSIWYG to “Source View”
      2. Paste the code where you want the PDF to be displayed
  17. View your web page in a web browser

You’ll probably notice a few issues with what you see. The box that contains your PDF is very small so you have to scroll horizontally and vertically to view the document. There is no way to zoom in and out on the document. Don’t fret, we can tweak the embed code so that your document is displayed in a more sensible manner. The following steps come courtesy of a blog post by Ben Schersten:

  1. Change your embed code
    1. From: <iframe src="[your-file-id]/pub?embedded=true"></iframe>
    2. To: <iframe src="[your-file-id]&pid=explorer&efh=false&a=v&chrome=false&embedded=true" width="580px" height="480px"></iframe>
  2. View your page now
    1. You can adjust the “width” and “height” attributes in your new embed code to adjust the size of the frame that contains your document

Congratulations! You now have a PDF that your audience can read but not copy on your web page.

Need help implementing this on your site?  Give us a call at 888-321-8422 (toll free) or fill out our contact form and we’ll be happy to reach out to you.

Have more questions? Submit a request
Powered by Zendesk