Table of Contents

Method Encryption

Namespace
BitMiracle.Docotic.Pdf.Layout
Assembly
BitMiracle.Docotic.Pdf.Layout.dll

Encryption(PdfEncryptionHandler?)

Sets the encryption handler to use while encrypting the output PDF.

public PdfDocumentBuilder Encryption(PdfEncryptionHandler? handler)

Parameters

handler PdfEncryptionHandler

The encryption handler to use while encrypting the output PDF. Can be null, which means non-encrypted document.

Returns

PdfDocumentBuilder

The updated builder.

Remarks

The library generates non-encrypted documents by default.

Set this property to an instance of PdfStandardEncryptionHandler to protect the output document with password(s).

Set this property to an instance of PdfPublicKeyEncryptionHandler to protect the output document with certificate(s).

Read the Building documents article for examples of using this method.

The Encrypt PDF documents in C# and VB.NET article explains how to create and use encryption handlers.