Table of Contents

Class Protection

Namespace
Rustaveli.Pdf
Assembly
Rustaveli.Pdf.dll

How a PDF is protected by password: what opens it, what lifts its restrictions, what a reader may do with it once open, and how strongly it is encrypted.

public sealed class Protection
Inheritance
Protection
Inherited Members

Remarks

Restrictions are honoured by readers, not enforced by the encryption: anyone who can open a file can read it. Only a user password keeps a file closed.

Only AesWith256Bits takes a password in any script; the older levels take PDFDocEncoding, roughly Latin-1, and a password with other characters is refused rather than weakened.

Properties

AllowAccessibility

Whether assistive technology may read the content out, even where copying is not allowed. PDF/UA requires it.

public bool AllowAccessibility { get; init; }

Property Value

bool

AllowAnnotating

Whether comments may be added and form fields filled in.

public bool AllowAnnotating { get; init; }

Property Value

bool

AllowAssembling

Whether pages may be inserted, rotated or removed, and bookmarks and thumbnails made.

public bool AllowAssembling { get; init; }

Property Value

bool

AllowCopying

Whether text and images may be copied out.

public bool AllowCopying { get; init; }

Property Value

bool

AllowFillingForms

Whether form fields may be filled in even where annotating is not allowed.

public bool AllowFillingForms { get; init; }

Property Value

bool

AllowHighQualityPrinting

Whether printing is faithful, rather than at the low resolution a reader falls back to.

public bool AllowHighQualityPrinting { get; init; }

Property Value

bool

AllowModifying

public bool AllowModifying { get; init; }

Property Value

bool

AllowPrinting

public bool AllowPrinting { get; init; }

Property Value

bool

EncryptMetadata

Whether the XMP metadata is encrypted too; off lets search engines read it without the password.

public bool EncryptMetadata { get; init; }

Property Value

bool

Encryption

public EncryptionLevel Encryption { get; init; }

Property Value

EncryptionLevel

OwnerPassword

The password that opens the file with every restriction lifted. When none is given one no one knows is made up, so the restrictions cannot be lifted at all.

public string? OwnerPassword { get; init; }

Property Value

string

UserPassword

The password that opens the file; empty, the default, opens it without asking.

public string UserPassword { get; init; }

Property Value

string