Table of Contents

Class PdfDocumentPermissions

Namespace
PdfEngine.Documents
Assembly
PdfEngine.Abstractions.dll

What the reader may do with an encrypted document (ISO 32000-2 7.6.4.2, Table 22), resolved for the way it was opened: the owner password (or a public-key recipient granted everything) lifts every restriction. For revision 2, the flags that revision 3 introduced (bits 9–12) follow the older bits they refine.

public sealed record PdfDocumentPermissions : IEquatable<PdfDocumentPermissions>
Inheritance
PdfDocumentPermissions
Implements
Inherited Members

Constructors

PdfDocumentPermissions(bool, bool, bool, bool, bool, bool, bool, bool, bool, bool)

What the reader may do with an encrypted document (ISO 32000-2 7.6.4.2, Table 22), resolved for the way it was opened: the owner password (or a public-key recipient granted everything) lifts every restriction. For revision 2, the flags that revision 3 introduced (bits 9–12) follow the older bits they refine.

public PdfDocumentPermissions(bool IsEncrypted, bool Unrestricted, bool CanPrint, bool CanPrintHighQuality, bool CanModify, bool CanCopy, bool CanAnnotate, bool CanFillForms, bool CanExtractForAccessibility, bool CanAssemble)

Parameters

IsEncrypted bool
Unrestricted bool
CanPrint bool
CanPrintHighQuality bool
CanModify bool
CanCopy bool
CanAnnotate bool
CanFillForms bool
CanExtractForAccessibility bool
CanAssemble bool

Fields

Owner

Encrypted but opened with full rights.

public static readonly PdfDocumentPermissions Owner

Field Value

PdfDocumentPermissions

Unencrypted

An unencrypted document: everything is allowed.

public static readonly PdfDocumentPermissions Unencrypted

Field Value

PdfDocumentPermissions

Properties

CanAnnotate

public bool CanAnnotate { get; init; }

Property Value

bool

CanAssemble

public bool CanAssemble { get; init; }

Property Value

bool

CanCopy

public bool CanCopy { get; init; }

Property Value

bool

CanExtractForAccessibility

public bool CanExtractForAccessibility { get; init; }

Property Value

bool

CanFillForms

public bool CanFillForms { get; init; }

Property Value

bool

CanModify

public bool CanModify { get; init; }

Property Value

bool

CanPrint

public bool CanPrint { get; init; }

Property Value

bool

CanPrintHighQuality

public bool CanPrintHighQuality { get; init; }

Property Value

bool

IsEncrypted

public bool IsEncrypted { get; init; }

Property Value

bool

RestrictionSummary

A short, human description of what is restricted, or empty when nothing is.

public string RestrictionSummary { get; }

Property Value

string

Unrestricted

public bool Unrestricted { get; init; }

Property Value

bool

Methods

FromFlags(int, int, bool)

Resolves /P (bit numbers are 1-based as in Table 22) for a security handler revision.

public static PdfDocumentPermissions FromFlags(int p, int revision, bool unrestricted)

Parameters

p int
revision int
unrestricted bool

Returns

PdfDocumentPermissions