Name
  doc:SetPermission -- set document permissions
Synopsis

      status = doc:SetPermission(permission)

Function
  `doc:SetPermission()` sets the permission flags for the document. `permission` must be combination of the following flags:

  `#HPDF_ENABLE_READ:`
    User can read the document.

  `#HPDF_ENABLE_PRINT:`
    User can print the document.

  `#HPDF_ENABLE_EDIT_ALL:`
    User can edit the contents of the document other than annotations, form fields.

  `#HPDF_ENABLE_COPY:`
    User can copy the text and the graphics of the document.

  `#HPDF_ENABLE_EDIT:`
    User can add or modify the annotations and form fields of the document.

  When `doc:SetPermission()` succeeds, it returns `#HPDF_OK`. Otherwise, it returns an error code and the error handler is called.

Inputs
  permission
    one or more permission flags (see above)
Results
  status
    status code
Errors
  `#HPDF_INVALID_DOCUMENT` - An invalid document handle was set.

  `#HPDF_FAILED_TO_ALLOC_MEM` - Memory allocation failed.

Show TOC