---
Product: Aspose.PDF
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/net/DocumentPrivilege
---

# DocumentPrivilege

## Overview

`DocumentPrivilege` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `IComparable`.

Represents document access permissions (P value in encryption dictionary).

This class provides 3 methods for working with DocumentPrivilege objects in .NET programs.
Available methods include: `CompareTo`, `DocumentPrivilege`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `AllowAll`, `AllowAssembly`, `AllowCopy`, `AllowDegradedPrinting`, `AllowFillIn`, `AllowModifyAnnotations`, and 15 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `AllowPrint` | `bool` | Read/Write | Allow printing (bit 3). |
| `AllowModifyContents` | `bool` | Read/Write | Allow modification of contents (bit 4). |
| `AllowCopy` | `bool` | Read/Write | Allow copying or extracting text and graphics (bit 5). |
| `AllowModifyAnnotations` | `bool` | Read/Write | Allow adding or modifying annotations (bit 6). |
| `AllowFillIn` | `bool` | Read/Write | Allow filling in form fields (bit 9). |
| `AllowScreenReaders` | `bool` | Read/Write | Allow extracting text for accessibility (bit 10). |
| `AllowAssembly` | `bool` | Read/Write | Allow document assembly (bit 11). |
| `AllowDegradedPrinting` | `bool` | Read/Write | Allow degraded (low-resolution) printing. |
| `ChangeAllowLevel` | `int` | Read/Write | Composite change-allowed level derived from the modify permission bits. |
| `CopyAllowLevel` | `int` | Read/Write | Composite copy-allowed level derived from the copy and accessibility bits. |
| `PrintAllowLevel` | `int` | Read/Write | Composite print-allowed level derived from the print and print-quality bits. |
| `AllowAll` | `DocumentPrivilege` | Read | All permissions granted. |
| `ForbidAll` | `DocumentPrivilege` | Read | No permissions (most restrictive). |
| `Print` | `DocumentPrivilege` | Read | Allows printing only. |
| `ModifyContents` | `DocumentPrivilege` | Read | Allows modifying contents only. |
| `Copy` | `DocumentPrivilege` | Read | Allows copying only. |
| `ModifyAnnotations` | `DocumentPrivilege` | Read | Allows modifying annotations only. |
| `FillIn` | `DocumentPrivilege` | Read | Allows filling in form fields only. |
| `ScreenReaders` | `DocumentPrivilege` | Read | Allows screen-reader extraction only. |
| `Assembly` | `DocumentPrivilege` | Read | Allows document assembly only. |
| `DegradedPrinting` | `DocumentPrivilege` | Read | Allows degraded printing only. |

## Methods

| Signature | Description |
|-----------|-------------|
| `DocumentPrivilege()` | Create a privilege set with no permissions (most restrictive). |
| `DocumentPrivilege(other: DocumentPrivilege)` | Create a copy of an existing privilege. |
| `CompareTo(obj: object?)` | Calls CompareTo on this DocumentPrivilege instance. |

## See Also

- [Aspose.PDF for .NET — Enterprise API Reference](https://reference.aspose.com/pdf/net/)