Some test text!

Loading...
Guides
DRM support

DRM support for document viewing

Encrypting with PDF

WebViewer supports loading PDFs that are encrypted with a PDFTron custom security handler. You will perform the encryption on the server side, choosing an application custom id and password and then WebViewer can decrypt them on the client side. Event if the document was downloaded outside of WebViewer, this security handler prevents other PDF viewers from decrypting the document.

See this guide for more information about DRM with PDF files.

Encrypting with XOD

An alternative is encrypting with XOD files. When deploying a custom server , WebViewer can convert a wide range of document formats to XOD (a web optimized XPS file format).

XOD documents can be encrypted at conversion time and WebViewer can view these documents when supplied with the password. These XOD documents are encrypted with 128 bit AES (Advanced Encryption Standard), a specification from the National Institute of Standards and Technology (NIST), and is used by governments and businesses worldwide.

This enables you to implement certain forms of DRM which can be useful if you want users to only be able to view documents inside the viewer and not simply download the files to view any time outside of it.

  • For example a web magazine viewer would likely not want users to simply download the magazines and send them to their friends. Note that the files may be able to be downloaded but they would be unviewable since they would be encrypted.

  • Another option would be that the server doesn't store the password, the user just has to enter it in the viewer before they can view the document, effectively password protecting the document.

Encrypt a document during XOD conversion

To encrypt a XOD document on conversion, you just need to pass in a password to encrypt the document with. You can call the ToXod method with XodOutputOptions. You can specify the password in the XodOutputOptions by calling SetEncryptPassword.

Decrypt a document on client-side

On the client-side, you will have to make some modifications to decrypt an encrypted XOD file. When using WebViewer you include an encryption property on the options object of WebViewer:

WebViewer({
  initialDoc: 'test.xod',
  encryption: {
    p: 'pass',
    type: 'aes',
    error: msg => { alert(msg); }
  }
}, viewerElement);

If you want to load a second password protected document you'll pass the encryption options to loadDocument:

WebViewer(...)
  .then(instance => {
    const { Encryption } = instance.Core;

    instance.UI.loadDocument('newdoc.xod', {
      decrypt: Encryption.decrypt,
      decryptOptions: {
        p: 'newpass',
        type: 'aes',
        error: msg => { alert(msg); }
      }
    });
  });

Get the answers you need: Support

Upcoming Webinar: PDFTron SDK Tech Review | Nov 29, 2022 at 2 pm ET

PDFTron SDK

The Platform

NEW

© 2022 PDFTron Systems Inc. All rights reserved.

Privacy

Terms of Use