CloudPDF
DocsPricing
Start building

What people can do

Every grant and every token says what people can do with the document. Pick a level, then what they may take with them: a copy of the file, a printout, or the text.

Levels#

Every level includes reading:

LevelPeople can
ReadSee the pages, search and select text, see comments and form values
CommentRead, and add comments, highlights and drawings, then change and delete their own
Fill and signRead, and fill in the form, submit it and sign it
EditEverything above on anyone’s work, and change pages, content and details

Download, Print and Copy text#

These three are off unless you turn them on, at any level:

People can
DownloadSave the PDF, with or without its annotations and form values drawn into the pages
PrintPrint the document, at high quality too
Copy textCopy what they select, and see the words around each search match

Without them, the document stays in the viewer: people can read it, but not take it with them.

In the dashboard#

Choose the level under People can, and tick what else they may do:

The grant dialog with Comment chosen, and Download and Print ticked

Pages show as#

With the Screenshot protection add-on, the grant dialog also asks how the pages show: Images, the default, or Protected. Protected sends each page as protected video, which screenshots and screen recordings don’t capture in most browsers. It turns off Download, Print and Copy text, since they would let the pages out.

In code#

A grant you make from your server, and a token for one of your users, take a list of permissions in scope. This file has the dashboard’s levels and extras as lists. Copy it into your app:

lib/permissions.ts
const read = [
  'doc.open',
  'doc.render',
  'doc.text.select',
  'doc.text.search',
  'doc.annotate.read',
  'doc.forms.read',
];
 
export const permissions = {
  read,
  comment: [
    ...read,
    'annotations:create:self',
    'annotations:update:self',
    'annotations:delete:self',
  ],
  fillAndSign: [
    ...read,
    'doc.forms.fill',
    'doc.forms.submit',
    'doc.sign',
  ],
  edit: [
    ...read,
    'doc.annotate.modify',
    'doc.forms.fill',
    'doc.forms.submit',
    'doc.forms.modify',
    'doc.sign',
    'doc.pages.assemble',
    'doc.pages.modify',
    'doc.metadata.modify',
    'doc.outline.modify',
    'doc.attachments.modify',
    'doc.redact',
  ],
  download: ['doc.download', 'doc.download.flattened'],
  print: ['doc.print', 'doc.print.high'],
  copyText: ['doc.text.copy'],
};

Then spread a level and the extras into scope:

import { permissions } from '@/lib/permissions';
 
await cloudpdf.grants.create({
  tenantId,
  docId: 'doc_20b05b13f613f795ffd14e57',
  name: 'Client review',
  scope: [
    ...permissions.comment,
    ...permissions.download,
    ...permissions.print,
  ],
});

A grant with exactly a level’s list, plus any extras, shows that level in the dashboard. Any other list shows as custom permissions.

In the fileThe dashboard’s
permissions.readRead
permissions.commentComment
permissions.fillAndSignFill and sign
permissions.editEdit
permissions.downloadDownload
permissions.printPrint
permissions.copyTextCopy text

Every permission#

A level is a set of permissions, and you can choose them one by one. In the dashboard, click Customize permissions:

The grant dialog with Customize permissions open, listing every permission by group

In code, each one is a name in scope:

PermissionName
Viewing
Open the document. Every grant and token needs itdoc.open
See the pagesdoc.render
Select textdoc.text.select
Search the text, and see where each match isdoc.text.search
See comments and annotationsdoc.annotate.read
See form fields and their valuesdoc.forms.read
Copy, print and download
Copy text, and see the words around search matchesdoc.text.copy
Printdoc.print
Print at high quality: 300 DPI instead of 150doc.print.high
Download the file, its attached files, exported annotations and extracted pagesdoc.download
Download a copy with annotations and form values drawn into the pagesdoc.download.flattened
Comments and annotations
Add their own, and change and delete themannotations:create:self, annotations:update:self, annotations:delete:self
Add, change and delete anyone’sdoc.annotate.modify
Import annotations with their original authorsdoc.annotate.import
Forms
Fill in form fieldsdoc.forms.fill
Submit the form to where it goesdoc.forms.submit
Create, change and delete form fieldsdoc.forms.modify
Import form fields and values with who filled them indoc.forms.import
Write scripts, submit buttons and links into fieldsdoc.forms.script
Pages and document
Rotate, move, delete, insert and name pagesdoc.pages.assemble
Change page content, such as flatteningdoc.pages.modify
Change the title, author and other detailsdoc.metadata.modify
Add, change and delete bookmarksdoc.outline.modify
Add and remove attached filesdoc.attachments.modify
Apply redactions, which remove content for gooddoc.redact
Signatures
Sign the documentdoc.sign
Sign as the certifying signature, which sets what later changes are alloweddoc.sign.certify
The PDF’s own permissions
Whatever the file’s own permission flags allow, on top of the abovepdf.permissions

Good to know#

  • “Their own” is who made it. On a token, that’s the userId your server put in its identity. On a grant, it’s each visitor: their browser keeps who they are between visits.
  • Applying a redaction needs three permissions: doc.redact, doc.pages.modify, and doc.annotate.modify, since a redaction starts as an annotation anyone may have drawn.
  • The viewer only shows what people can do. Without Download, there’s no download button; with Read, the editing tools don’t appear.