Table of Contents

Class PdfEncryptionOptions

Namespace
CobaltPdf
Assembly
CobaltPdf.dll

Defines password protection and permission settings for the generated PDF.

public sealed class PdfEncryptionOptions
Inheritance
PdfEncryptionOptions
Inherited Members

Remarks

When specified, the generated PDF will be encrypted after rendering. If OwnerPassword is not provided, a secure random value will be generated internally.

Properties

AllowCopying

Gets or sets whether text and content extraction (copying) is permitted.

public bool AllowCopying { get; init; }

Property Value

bool

Remarks

Defaults to false.

AllowModification

Gets or sets whether the document can be modified.

public bool AllowModification { get; init; }

Property Value

bool

Remarks

Defaults to false.

AllowPrinting

Gets or sets whether printing the document is permitted.

public bool AllowPrinting { get; init; }

Property Value

bool

Remarks

Defaults to true.

OwnerPassword

The password that controls document permissions.

public string? OwnerPassword { get; init; }

Property Value

string

Remarks

Also known as the "owner password". This password allows overriding permission restrictions such as printing or content extraction. If not specified, a secure random password will be generated.

UserPassword

The password required to open the PDF document.

public string UserPassword { get; init; }

Property Value

string

Remarks

This is commonly referred to as the "user password". The document cannot be opened without this password.