add method

void add(
  1. PdfPermissionsFlags permission
)

Add the permission.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Document security
PdfSecurity security = document.security;
//Add permission.
security.permissions.add(PdfPermissionsFlags.editContent);
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

void add(PdfPermissionsFlags permission) {
  if (!_permissions.contains(permission)) {
    _permissions.add(permission);
    _encryptor.permissions = _permissions;
    _encryptor.encrypt = true;
    _modifiedPermissions = true;
  }
}